Traceability in a modeling environment

ABSTRACT

Exemplary embodiments employ a mapping among entities that are related to each other. The entities may include a graphical model, generated code, a generated report, a requirements document and/or an intermediate representation. The mapping may facilitate graphical identifications between parts of one entity that maps to part of another entity. The graphical identification may occur based on a selection of a part in one of the entities.

RELATED APPLICATIONS

This application is a continuation-in-part, and claims priority to U.S.application Ser. No. 10/057,126, filed Oct. 25, 2001 and U.S.application Ser. No. 10/637,433, filed Aug. 7, 2003. This applicationalso claims the benefit of, said Applications for all subject matter incommon with this application. The disclosures of said Applications arehereby incorporated by reference in their entirety.

BACKGROUND

Graphical modeling environments, such as Simulink® software from TheMathWorks, Inc. of Natick, Mass., cater to various aspects of dynamicsystem simulation, analysis and design. Such products allow users toperform numerous types of tasks including constructing system blockdiagram models. These graphical modeling environments may also be usedto augment a predefined set of blocks with custom user-specified blocks,to compute and trace the temporal evolution of the dynamic system(“executing” the block diagram), to produce deployable software systems,or to produce descriptions of hardware systems that can mimic thebehavior of either the entire model or portions of the model (referredto herein as “code generation”).

A code generation process may be complicated. While it is may not beimportant for users of graphical modeling environments to understand thedetails of how the code generation process works, it can be importantfor users to understand the mapping between parts of the graphical modeland parts of the generated code. Conventional systems and/or techniquesmay not provide users with the ability to readily understand mappingsbetween parts of a graphical model and parts of generated code.

SUMMARY

In one aspect a computer-implemented method is disclosed. The methodincludes identifying entities having relationships therebetween. Theentities include at least one of a graphical model, generated code, agenerated report, a requirements document or an intermediaterepresentation. The method also includes accessing a first entity fromthe entities and accessing a second entity from the entities. The methodfurther includes mapping the first entity to the second entity tofacilitate graphical identification of a first part of the first entitythat is bi-directionally mappable to a second part of the second entity.

In another aspect, a computing system is disclosed. The computing systemincludes a code generator and an integrated environment. The codegenerator produces generated code that corresponds to at least part of agraphical model. The generated code includes one or more segments. Theintegrated environment bi-directionally maps content related to thegraphical model to the one or more segments. The integrated environmentfurther allows identification of the content mapped to the one or moresegments or allows identification of the one or more segments mapped tothe content.

In yet another aspect, a medium that holds instructions executable usinga computing device is disclosed. The instructions enable identifyingentities having relationships therebetween. The entities include atleast one of a graphical model, generated code, a generated report, arequirements document or an intermediate representation. Theinstructions also enable accessing a first entity from the entities andaccessing a second entity from the entities. The instructions furtherenable mapping the first entity to the second entity to facilitategraphical identification of a first part of the first entity that isbi-directionally mappable to a second part of the second entity.

In still another aspect, a computer-implemented method is disclosed thatincludes accessing generated code corresponding to at least portion of agraphical model. The method also includes identifying a first graphicalaffordance in the graphical model that corresponds to a first segment ofthe generated code, the identifying performed graphically.

In an additional aspect, a medium that holds instructions executableusing a computing device, where the instructions enable interacting withcode generated on behalf of at least part of a graphical model. Thegenerated code includes at least a first segment. The instructionsfurther enable identifying a first graphical affordance in the graphicalmodel that corresponds to the first segment, the identifying performedgraphically.

In a further aspect, a computer-implemented method is disclosed thatincludes accessing code generated corresponding to at least a portion ofa graphical model and identifying a first segment in the generated code,the first segment corresponding to a first graphical affordance in thegraphical model, the identifying performed graphically.

In yet a further aspect, a medium that holds instructions executableusing a computing device, where the instructions enable accessing codegenerated corresponding to at least part of a graphical model andidentifying a first segment in the generated code corresponding to afirst graphical affordance, the identifying performed graphically.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate one or more exemplary embodimentsand, together with the description, explain the invention. In thedrawings,

FIG. 1 depicts a high-level block diagram of an exemplary graphicalmodeling environment that may be used for implementing various exemplaryembodiments;

FIG. 2 depicts an exemplary computing device suitable for practicing anillustrative embodiment;

FIG. 3 depicts an exemplary distributed system suitable for adistributed implementation of exemplary embodiments;

FIGS. 4A-4C depict a flow diagram that illustrates exemplary steps forproviding traceability between a graphical model and generated code;

FIG. 5A depicts an exemplary graphical model, exemplary generated codeand an exemplary generated report in accordance with exemplaryembodiments;

FIG. 5B depicts an exemplary graphical identifier for identifyingsegments of the exemplary generated code and sections of the exemplarygenerated report of FIG. 5A;

FIG. 5C depicts another exemplary graphical identifier for identifyingsegments of the exemplary generated code and sections of the exemplarygenerated report of FIG. 5A;

FIG. 5D depicts unique graphical identifiers for identifying segments ofthe exemplary generated code and sections of the exemplary generatedreport of FIG. 5A that correspond to various aspects of a graphicalaffordance in the exemplary graphical model of FIG. 5A;

FIG. 6A is a flow diagram that depicts exemplary steps for graphicallyidentifying segments of generated code or sections of a generated reportbased on selected graphical affordances;

FIG. 6B is a flow diagram that depicts exemplary steps for uniquelyidentifying segments of the generated code or sections of a generatedreport based on corresponding aspects of a graphical affordance;

FIG. 7 depicts an exemplary menu that allows the user to specify whatsegments of the generated code or sections of a generated report theuser wants to identify;

FIG. 8 depicts an exemplary graphical identification of a segment ofgenerated code based on a selection of a graphical affordance in agraphical model;

FIG. 9 is a flow diagram that depicts exemplary steps for graphicallyidentifying a segment of generated code or a section of a generatedreport associated with an aspect of a graphical affordance in agraphical model based on a scope;

FIG. 10 depicts a graphical identification of a graphical affordance ina graphical model using an exemplary technique;

FIG. 11A is a flow diagram that depicts exemplary steps for graphicallyidentifying graphical affordances in a graphical model that correspondto selected segments of generated code or selected sections of agenerated report;

FIG. 11B is an exemplary flow diagram for uniquely identifying aspectsof a graphical model based on a corresponding segment in the generatedcode;

FIG. 11C is an exemplary flow diagram for graphically identifyingaspects in a graphical model associated with a segment in the generatedcode based on a scope associated with the model;

FIG. 12 is an exemplary graphical model that includes a user specifiedelement and/or generated code from the graphical model;

FIG. 13A is a flow diagram that depicts exemplary processing that can beused for illustrating the mapping between a requirements document and agraphical model;

FIG. 13B is a flow diagram that depicts exemplary processing that can beused for illustrating the mapping among a requirements document,generated code and/or a generated report;

FIG. 14A depicts the exemplary graphical model and generated code ofFIG. 5 along with an example of additional information that can bedisplayed to a user;

FIG. 14B is a flow diagram that depicts exemplary processing that can beused for graphically identifying undisplayed information;

FIG. 15A depicts an exemplary graphical model that may be developed inaccordance with exemplary embodiments;

FIG. 15B depicts exemplary code files that may be generated from thegraphical model of FIG. 15A;

FIG. 16A is an exemplary deployable representation in accordance withexemplary embodiments;

FIG. 16B is an exemplary deployable representation of tracinginformation;

FIG. 17 is a flow diagram that depicts exemplary processing that can beused for implementing an external debugger on the generated code;

FIG. 18A depicts an exemplary graphical model and code generated fromthe graphical model;

FIG. 18B depicts changing an operator in the generated code of FIG. 18A;

FIG. 18C depicts generating code for a graphical model and/or generatingcode for a modified version of the graphical model;

FIG. 18D depicts an exemplary graphical model, generated code and userinterface for implementing round trip editing according to exemplaryembodiments;

FIG. 19 is a flow diagram that depicts exemplary processing that can beused for round-trip editing;

FIG. 20A is a flow diagram that depicts exemplary processing that can beused for using a search and replace operation for a graphical model;

FIG. 20B is a flow diagram that depicts exemplary processing that can beused for using a search and replace operation for generated code;

FIG. 21 is a flow diagram that depicts exemplary processing that can beused for locking aspects of a graphical model and generated code; and

FIG. 22 is an exemplary diagram of entities that can be mapped usingtracing techniques.

DETAILED DESCRIPTION

Exemplary embodiments described herein provide a graphical modelingenvironment to allow a user to generate a graphical model that maps tomultiple entities. The entities may include a requirements document,generated code, an intermediate representation, a generated report, etc.These entities may also be mapped to one another.

The mapping between the entities may be bi-directional. For example, agraphical model can be mapped to generated code and vice versa. Thebi-directional mapping may facilitate graphical identification ofportions of the graphical model that correspond to selected segments ofthe generated code. The bi-directional mapping may also facilitategraphical identification of segments of generated code that correspondto selected portions of a graphical model. The parts of the entitiesthat map to one another may use a one-to-one mapping, a one-to-manymapping, a many-to-one mapping, a many-to-many mapping, etc. Thebi-directional mapping may be injective, subjective, bijective, etc. Inan injective mapping, for example, each part of a first entity is mappedto a corresponding part of a second entity in a one-to-one fashion, butthe second entity may have parts, for which the first entity does notmap to. In a surjective mapping, for example, each part of a firstentity is mapped to a corresponding part on a second entity. Asurjective mapping allows more than one part of the first entity to mapto a single part of the second entity. In subjective mapping all partsof the first and second entity have corresponding parts. A bijectivemapping is both injective and surjective. A bijective mapping allows foreach part of a first entity to map to a corresponding part of a secondentity in an one-to-one fashion, such that each part of the first andsecond entities is mapped to single corresponding part and there are noparts of the first and second entities that are not mapped to oneanother.

The graphical model may represent a system, such as a dynamic system,and may be executable in the graphical modeling environment. A graphicalmodel may be represented as, for example, a block diagram model, dataflow model, state-diagram model, etc. Some possible examples of suitablegraphical modeling environments that may be used to develop a graphicalmodel in accordance with exemplary embodiments are, but are not limitedto, Simulink® software and/or Stateflow® software from the MathWorksInc. of Natick Mass., LabVIEW® or MATRIXx from National Instruments,Inc., Mathematica® from Wolfram Research, Inc., Mathcad of MathsoftEngineering & Education Inc., Maple™ from Maplesoft, a division ofWaterloo Maple Inc., Dymola from Dynasim AB of Lund, Sweden, Extend fromImagine That, Inc. of San Jose, Calif., Scilab™ and Scicos from TheFrench National Institution for Research in Computer Science and Control(INRIA), Le Chesnay Cedex, France, MSC.Adams® from MSC.SoftwareCorporation of Santa Ana, Calif., modeling software from dSPACE ofPaderborn, Germany, electronic design automation (EDA) software fromCadence™ of San Jose, Calif. or Synopsis® of Mountain View, Calif., theBEACON software family from Applied Dynamics International of Ann Arbor,Mich., etc. In addition, modeling environments, such as those thatsupport modeling physics-based domains, Unified Modeling Language (UML)like Rhapsody® from iLogix, Inc. of Toronto, Canada or Rational® fromInternational Business Machines Corporation of Armonk, N.Y., or SysMLlike ARTiSAN Studio from ARTiSAN Software Tools, Inc of Beaverton, Oreg.or Rhapsody® from iLogix, Inc., etc., may be suitable for implementing agraphical model in accordance with the exemplary embodiments.

Exemplary graphical models may be developed based on a set ofrequirements that may be contained in one or more machine-readablestructures, such as a text file, a spreadsheet, a word processing file,a presentation application file, database, repository, etc., which willgenerally be referred to herein as a “requirement documents”. Therequirements may be subject to version control by a version controlsystem to enable tracking of versions when the requirements change. Insome instances, the requirements may be included in the graphical modelsuch that the requirements and the design (i.e., the graphical model)are in the same location. The requirements may be mapped to thegraphical model and/or generated code to facilitate graphicalidentification of requirements that map to graphical affordances in agraphical model and/or segments in generated code. The graphicalaffordances or segments may also be graphically identified based on aselection of a requirement.

Generated code may be generated in a programming language, such as C,C++, JAVA®, Javascript, an assembly language, etc.; a hardwaredescription language, such as Verilog, VHDL (very high speed integratedcircuit hardware description language), etc.; a register transferlanguage (RTL); etc. Implementations may further generate informationabout a graphical model using a programming language, alone or incombination with the generated code discussed above. In one example, anXML representation may be used to include meta-information about themodel, such as, which functions should be called and in what order;which task should be called and at what rate; what types input argumentshave; etc.

Exemplary embodiments may further enable graphically identifyingsegments in generated code that correspond to selected graphicalaffordances in the graphical model. In this manner, a user may viewsegments of generated code that map to selected graphical affordances.Graphical affordances, as used herein, refer to aspects of a graphicalmodel that are displayed in the graphical model and may include, forexample, elements, signals, annotations, etc.

The term signal discussed herein refers to data that is passed to orfrom elements in a graphical model. A signal may be composed of datavalues calculated based on the execution of an element in a graphicalmodel. A signal may be associated with a unit of measurement such astime, velocity, acceleration, voltage, current, etc., or may be aunitless data value. A signal may be represented by various data typesincluding unsigned bytes or words, signed bytes or words, double,integers, floating point notations, etc. Signals may use frame basedtransmission formats for passing data to and from elements in agraphical model and/or may use non-frame based transmission formats.

A frame, as used herein, refers to a temporal collection of datasamples. For example, a frame may include a fixed number of data samplesthat are transmitted as a unit from one element to another element in amodel during a given period. The samples in a frame may, for example,represent a serial stream of data that is transmitted during a specifiedtime period. For example, a user or system may determine a time intervalfor a stream of data that is assembled into one or more frames. When anassembled frame is transmitted, all samples in the frame may be sent atsubstantially the same time.

A graphical affordance may be used to map segments of generated code inexemplary implementations. Further, portions of a graphical affordancemay be selected and graphically identified in generated code. Forexample, a user may select an input of a graphical affordance thatrepresents an element in a graphical model and a segment in generatedcode that corresponds to the selected input may be graphicallyidentified to the user. Likewise, a user may select a graphicalaffordance and various parts of the graphical affordance may be uniquelyidentified in the generated code by a graphical identifier. Examples ofparts of a graphical affordance may include, but are not limited to,signal names, input variables, element parameters, output variables,etc.

Exemplary embodiments may enable the graphical identification ofgraphical affordances. For example, a user may select a segment ofgenerated code, and the selected segment may map to a graphicalaffordance in a graphical model. Upon selecting the segment, thegraphical affordance that corresponds to the selected segment may begraphically identified. In one example, the graphical identification isachieved by highlighting the graphical affordance. In this manner, auser may view portions of the graphical model that map to selectedsegments of generated code. Exemplary embodiments may allow a segment ofgenerated code to map to a graphical affordance, various graphicalaffordances, portions of a graphical affordance, etc.

When code is generated, one or more intermediate representations (IRs)may be generated. An IR, as used herein, refers to a representation,such as a data structure that is stored in memory, a file, a database,or any other acceptable storage medium. The IR can be constructed frominput data contained within a source language (i.e., a language used bya graphical model) and from which part or all of the target languageinformation (i.e., generated code) is constructed. One example of anintermediate representation that can be used with exemplary embodimentsis a control flow graph (CFG). An IR may have meta tags to identifywhere the content of the IR is derived from. A meta tag associates thecontent of the IR with content that is used to generate the IR. Thecontent of an IR may be derived from, for example, elements in agraphical model, optimization rules, model configuration options, etc.

Exemplary embodiments may also enable round-trip editing between agraphical model and generated code related to the graphical model.Round-trip editing allows a user to modify segments of generated code orportion of a graphical model without requiring a complete regenerationof generated code and/or the graphical model. The round-trip editing mayenable, for example, regeneration of only the generated code that isaffected by the modifications. For example, a user may generate codefrom a graphical model and may subsequently modify a portion of thegraphical model. A segment of generated code that corresponds to themodified portion of the graphical model may be updated, while theremaining segments of generated code are unaffected. Subsequently, theuser may modify a segment in generated code. After modifying thesegment, a portion of the graphical model that corresponds to thesegment may be updated, while the remaining portions of the graphicalmodel are unaffected.

A user may implement a search operation to search for recurringgraphical affordances or segments of generated code. Segments ofgenerated code that correspond to the recurring graphical affordancedetected by the search may be graphically identified. Likewise,graphical affordances of a graphical model that correspond to recurringgenerated code segments detected by the search may be graphicallyidentified. The recurring graphical affordances or recurring segmentsmay be replaced with another graphical affordance and/or segment,respectively, by the user. When the recurring graphical affordance isreplaced, generated code may be updated so that segments in generatedcode that correspond to the recurring graphical affordance are replacedto reflect the replacement of the recurring graphical affordance.Similarly, when the recurring segment is replaced, the graphical modelmay be updated so that graphical affordances that correspond to therecurring segment are replaced to reflect the replacement of therecurring segment.

Tracing information that associates graphical affordances with segmentsin generated code may be generated. The tracing information may providea complete mapping between the graphical model and generated code andmay be an independent representation stored in, for example, anindependent file, database, repository, etc. A programmable applicationprogram interface (API) may be provided that allows interaction with theindependent representation of tracing information. The programmable APImay allow a user to develop and/or use an external debugger fordebugging generated code or a graphical model. In this manner, the usermay create a debugging application that is independent from thegraphical modeling environment. Exemplary implementations of thedebugging application may interact with the graphical modelingenvironment through the programmable API. The programmable API may allowfor programmatic and/or graphical identification of segments ofgenerated code or graphical affordances of the graphical model based onthe tracing information in the independent representation.

Exemplary embodiments may further provide generated reports that may begenerated from a graphical model and/or generated code. The generatedreports may be mapped to the graphical model and/or generated code toallow for graphically identifying sections in the generated report. Themapping may also allow graphically identifying portion of the graphicalmodel or segments of generated code based on a selection of one or moresections in the generated reports. Generated reports may include alisting of generated code, information regarding how the generated codewas generated, information regarding an execution of a graphical model,generated code, etc.

FIG. 1 is an exemplary high-level block diagram of the graphicalmodeling environment 100 (hereinafter environment 100) for modeling,simulating, analyzing, etc., systems, such as dynamic systems. Theenvironment 100 may include a graphical modeling interface 110(hereinafter interface 110), a textual interface 130, an executionengine 140, a code generating tool 150, a report generating tool 160,and one or more programmable application program interfaces (APIs) 170.The environment 100 may be an integrated environment and may allow auser to simultaneously view a graphical model and generated code. Toenable simultaneous viewing, the environment 100 may be implemented as aMultiple Document Interface (MDI) application.

The environment 100 allows a user to develop graphical models using theinterface 110. The interface 110 can be a graphical user interface thatmay include a canvas that is represented by a graphical area on theinterface 110. The canvas may allow a user to develop and/or viewgraphical models. For example, a user can place elements 114, 116 and/or118 on the canvas to create the graphical model 112. The interface 110may also provide options to allow the user to generate code and/or areport from the graphical model 112. Interface 110 may also allow a useror the environment 100 to add elements, delete elements, replaceelements, etc., in the graphical model 112. For example, a user maycreate the graphical model 112 via the interface 110. The createdgraphical model 112 may represent a model of a system, such as a dynamicsystem and/or another type of system. The user may use predefinedelements (e.g., system defined, environment defined, etc.) oruser-defined elements to develop graphical model 112.

Elements 114, 116 and/or 118 may represent, but are not limited tocontinuous and/or discrete dynamics elements, such as integrationelements, unit delay elements, etc.; algorithmic elements, such as sum,product, lookup tables, etc.; and/or structural elements, such asmultiplexers, switches, signal or bus selectors, etc. Elements 114, 116and/or 118 may also represent states, where the graphical model 112 mayinclude a state diagram model. Elements 114, 116 and/or 118 may be usedin the graphical model 112 to develop a model of a system, such as adynamic system. Elements 114, 116 and/or 118 may be supplied by theenvironment 100. The environment 100 may allow a user to alterenvironment supplied elements 114, 116 and/or 118 or create customizedelements. In another implementation, a user may supply one or more ofelements 114, 116 and 118. For example, a user may create elements 114,116 and/or 118, thereby implementing user specified elements 114, 116and/or 118. The user supplied elements 114, 116 and/or 118 that maycontain programming language statements or instructions in a technicalcomputing language.

Elements 114, 116 and 118 may have parameters. Parameters may affect thefunctionality or execution of the graphical model 112. Parameters thataffect the functionality or execution of the graphical model may bereferred to as functional parameters. Some examples of functionalparameters include, for example, a sample time parameter that determineswhen the elements 114, 116 and/or 118 execute, scaling parameters thatmay affect the magnitude of an output of the element 114, 116 or 118,data type that determines the format in which data is passed from oneelement to another, etc. Parameters may also be nonfunctional in thatthey do not affect the functionality or execution of the graphicalmodel. Some examples of nonfunctional parameters include, for example,an element name, an elements appearance, annotated text that isassociated with the element, etc. Nonfunctional parameters may also beassociated with characteristics such as power consumption, executiontime, and weight.

Elements 114, 116 and/or 118 may be connected to each other to passsignals in the graphical model 112. Signals may be passed to and/or fromelements in the graphical model 112. The signals can be represented byvarious types, such as integer, floating point, double, unsigned, signedbytes or words, etc. The signals may be contained in a bus format and/ormay use frames. A bus format, as referred to herein, provides a formatfor transmitting a collection of signals to and from elements in agraphical model. A bus format may have a bus width that indicates howmany signals the bus contains. When signals are in a bus format thesignals may be transmitted to the same element or may be transmitted todifferent elements that are connected to the bus. Frames, as referred toherein, are a temporal collection of data samples. For example, a framecan include fixed number of data samples that are transmitted as unitfrom one element to another element in a model. The samples in a framemay, for example, represent a serial stream of data that is transmittedduring a specified time period. For example, a user or system candetermine a time interval for a stream of data that is assembled intoone or more frames. When an assembled frame is transmitted, all samplesin the frame may be sent at substantially the same time.

The textual interface environment 130 allows a user to develop auser-specified element (e.g., element 114) with code in a textuallanguage. Code developed using the textual interface 130 may be includedas, for example, the element 114 in the graphical model 112. The textualinterface 130 may also facilitate debugging and profiling of graphicalmodel 112 or the environment 100 may include a separate graphicaldebugger and profiler (not shown in FIG. 1).

The execution engine 140 may communicate with the interface 110. Theexecution engine 140 can receive the graphical model 112, which mayrepresent, for example, a block diagram, state diagram, data flowdiagram, etc., that is generated using the interface 110. The executionengine 140 may simulate the graphical model 112 in one implementation.The execution engine 140 may generate data from the execution of thegraphical model 112. The data may be displayed to a user in a textual orgraphical form. For example, the data may be presented to the user intable form or in graph form. The environment 100 may use a centralizeddata viewer to view the data generated by the execution engine 140.

The execution engine 140 may use numerical integration methods tocompute behavior for differential equation as well as differenceequation models. These numerical integration methods may be explicit andimplicit as well as fixed step or variable step. A zero-crossingdetection and location mechanism may be used by the execution engine 140to identify and locate times at which events occur, such as a modeledcollision between two rigid bodies. The execution engine 140 may handledifference equations by precomputing a static schedule of times whenvalues change. This static schedule may employ a base rate that is thegreatest common denominator of all sample times that are scheduled forexecution by the execution engine 140. The execution engine 140 mayhandle discrete event systems based on a base rate or by using adynamical scheduling mechanism, such as an event calendar. The executionengine 140 may employ any combination and/or permutation these features.Part or all of the functionality of the execution engine 140 can beincluded in generated code and it may be optimized in a similar manneras generated code.

The code generating tool 150 may generate code, such as source code,object code, a compiled executable, a library, etc., for forming anexecutable representation of the graphical model 112 provided by theinterface 110. The code generating tool 150 may also be used to generatea hardware description language (HDL) or a register transfer language(RTL) representation of the graphical model 112. The generated code maybe stored in multiple files. For example, part of the generated code maybe stored in a header file, while another part of generated code may bestored in a source file. In an exemplary implementation, code generatingtool 150 may include a code generating tool such as Real-Time Workshop™from The MathWorks, Inc. of Natick, Mass., or any software tool that maybe capable of generating executable code, instructions, etc., in aprogramming language such as JAVA®, Javascript, Python™, C, C++, anassembly language, etc.; a hardware description language such asVerilog, VHDL, etc.; RTL; etc. To generate code the code generating tool150 may convert a source model language representation of the graphicalmodel 112 to a target language representation.

During the code generation process, the code generating tool 150 maygenerate one or more IRs prior to generating code from the graphicalmodel 112. For example, the code building tool 150 may generate an IRand may subsequently generate code from the IR. The IR may be a CFG thatcaptures the semantics of the graphical model 112. An IR represented bya CFG may include nodes that represent algorithmic aspects of thegraphical model 112 and edges that indicate the flow of the algorithms.

The code generating tool 150 may generate code for the execution of thegraphical model 112 that is provided by the interface 110. The codegenerating tool 150 may also compile generated code into object code andbuild an executable program, library or any other form of executableinstructions. The generated code may be designed to run on anyprocessor, microprocessor, dual-core processor, multi-core processor,cluster of processors, digital signal processor (DSP), system on chip(SOC), reconfigurable signal conditioning hardware, operating system,computational hardware device, component of a computational hardwaredevice, etc. In one embodiment, generated code may include embedded codetargeted to run on any type of embedded system. For example, generatedcode may be implemented as firmware in an electronic system that uses amicroprocessor or a microcontroller. Additionally, generated code can becustomized to run on a specific target hardware platform. For example,generated code may include fixed-point code to run a fixed-pointprocessor or generated code may emulate fixed-point behavior on afloating-point processor.

The graphical model 112 may include directives as how generated codeshould be generated. For example, the element 114 in the graphical model112 may be directed to have a corresponding function, method, procedure,etc., to be generated in generated code with an argument list and nameas directed by the code generating tool 150. A function, method,procedure, etc., as used herein refers to a segment of code that has adefined interface for passing arguments. For clarity, the termsfunction, method, procedure, etc., will be referred to hereinaftersimply as a function. A function performs an operation that is definedby the content in the function. The function may or may not return avalue when the operation is complete. The function may be reused byother graphical model elements (e.g., elements 116, 118, etc.) with thesame, or similar, functionality. Generated code may be that of aprogramming language, such as JAVA®, Javascript, C, C#, C++, an assemblyprogramming language, etc.; a hardware description language, such asVerilog, VHDL, etc.; RTL; etc.

Further, optimizations such as expression folding, function inlining,function outlining, constant propagation, etc., may be applied togenerated code. Expression folding refers to reducing multipleexpressions to a single expression in generated code. Function inliningrefers to placing the contents of a function inline so that when afunction is called the function does not have to go to a call site thatis external to the body of generated code to perform its operation.Function outlining refers to outlining an inlined function such thatwhen the function is called the function has to go to a call site thatis not part of the body of generated code. Constant propagation refersto replacing variables that reference a constant with the constant.

In one embodiment, the environment 100 may read code and may createcorresponding elements in the graphical model 112. For example, aninclude file that contains code, such as, a struct definition, may beread by the environment 100 and a corresponding element (e.g., element114) may be created in the graphical model 112. Alternatively, the codemay include variables that are associated to memory locations and alocation or reference that corresponds to the memory locations (e.g.,pointer) may be provided in the graphical model 112.

The report generating tool 160 generates a report. The generated reportmay be, for example, a document structured with sections correspondingto different elements of the graphical model 112 representation, acoverage report, a model checking report, a code generation reportincorporating syntax highlighted code, a profiling report that documentsrelative execution times of each of the elements, etc. Coverage reports,such as a code coverage report, a model coverage report, decisioncoverage report, condition coverage report, a condition/decisioncoverage report, a structural coverage report, etc., are reports thatprovide the user with information for determining how well the graphicalmodel 112 and/or generated code cover a desired characteristic. Forexample, a user can develop the graphical model 112 based onrequirements and can generate code from the graphical model 112. Theuser can generate a model and/or code coverage report that providesinformation on whether the graphical model 112 and/or generated codemeet the requirements. When generating a coverage report, a series oftests may be performed on the graphical model 112 and/or generated codeto determine whether the requirements are met. The tests may serve toexecute the graphical model 112 and/or generated code to exercise thefunctionality of the graphical model 112 and/or generated code. A modelchecking report provides an assessment of whether a certain conditioncan be satisfied, given a number of assumptions. For example, a modelchecking report may provide an assessment whether a signal may become 0when another signal is always between 0 and 1. The generated report caninclude a document that may use navigable links, such as a mark uplanguage document and may contain information relating to the graphicalmodel 112, settings of the code generating tool 150 and/or the generatedsoftware (code).

The programmable APIs 170 can allow a user to interface the environment100 with an external browser and/or debugger. The programmable API 170can allow the user to browse or debug generated code and/or thegraphical model 112 and to programmatically identify a code segment ingenerated code that corresponds to a graphical affordance in thegraphical model 112 or to programmatically identify a graphicalaffordance in the graphical model 112 that corresponds to a segment ingenerated code using the external browser and/or debugger. For example,an identified graphical affordance may include an element, a signal, anannotation, etc. The programmable API 170 can allow the externalbrowsing or debugging to graphically identify segments of generated codeor portions of the graphical model 112. An external code browser and/ordebugger can use tracing information and the programmable API 170 tobrowse and/or debug the graphical model 112 and/or generated code.

When generating an IR, code, a report, etc., the environment 100 may usetransformation rules. Transformation rules, for example, may determinehow an element is represented in the IR or generated code. For example,there may be a transformation rule relating to the element 114 fortransforming the element 114 into a section of the IR and there may beanother transformation rule for transforming the section of the IR intogenerated code. The transformation rules may exist in a computerreadable medium and may be contained in a file, database, repository,etc. In some embodiments a graph rewriting system may be used toimplement a transformation rule. Graph rewriting systems may also bereferred to as using a “graph grammar”. Graph grammar may use patternmatching for replacing one graph structure with another. There arenumerous ways to implement pattern matching. One common implementationis guided by heuristics to manage the computational complexity. Graphgrammar may employ any number of rewriting rules (transformation rules)that can be extended by textual transformation information. Someembodiments may implement triple graph grammar or a higher order ofgraph grammar when generating an IR, code, a report, etc. Transformationrules, such as those implemented using triple graph grammar, may allow,for example, mapping between a first entity (e.g., an IR, generatedcode, a generated report, etc.), a second entity that is generated fromthe first entity, and the information (e.g., transformation rules) usedto generate the second entity.

The programmable APIs 170 may also enable graphically identifyinggraphical affordances or segments of generated code that correspond to agraphical interface of a user-specified element (e.g., element 114). Forexample, a user may define a function in a programming language, such asMATLAB.RTM., C, C++, JAVA®, Javascript, etc., and the user mayincorporate the function into the graphical model 112. The code for theuser-specified element may be developed using the textual interface 130or any other application that allows a user to develop textual code,such as a word processing application, a code browser, etc. The functioncan be represented by a graphical affordance that has a graphicalinterface. The graphical interface can represent, for example, inputs,outputs, triggers, etc., and may enable other elements in the graphicalmodel 112 to connect to the element that represents the function.

One of ordinary skill in the art will also appreciate that thecomponents of the environment 100 may be provided on a single computingdevice, as described below with reference to FIG. 2, on multiplecomputing devices (e.g., in a distributed configuration), and/or inother configurations (e.g., a multi-core implementation operating on oneor more platforms).

FIG. 2 is an exemplary computing device 200 suitable for practicing theexemplary embodiments. The implementation of FIG. 2 is illustrative andnot limiting. The computing device 200 may take many forms, includingbut not limited to a personal computer, workstation, server, networkcomputer, quantum computer, optical computer, bio computer, Internetappliance, mobile device, a pager, a tablet computer, a smart sensor,application specific processing device, etc.

The computing device 200 may be electronic and may include a CentralProcessing Unit (CPU) 205, memory 210, storage 215, an input control220, a modem 225, a network interface 230, a display 235, processor 270and a graphical processing unit (GPU) 290. The CPU 205 may controlcomponents of the computing device 200 to provide the interface 110, thetextual interface 130, the execution engine 140, the code generatingtool 150, the report generating tool 160, and/or one or moreprogrammable APIs 170. The memory 210 may store instructions and data,and may provide the instructions and data to the CPU 205. CPU 205 mayoperate the computing device 200 and may run the interface 110, thetextual interface 130, the execution engine 140, the code generatingtool 150, the report generating tool 160, and/or one or moreprogrammable APIs 170 based on the stored instructions.

Optionally, the computing device 200 may include multiple CPUs 205 forexecuting software loaded in the memory 210, and other programs forcontrolling system hardware. Each of the CPUs 205 can be a single or amultiple core processor 206. The code loaded in the memory 210 may runin a virtualized environment, such as in a Virtual Machine (VM) 211.Multiple VMs 211 may be resident on a single processor. Also, part ofthe application may run in processor 270, which may include, forexample, a field programmable gate array (FPGA) 272, programmable logiccontroller (PLC) 274, an application specific integrated circuit (ASIC)276, an application specific instruction set processor (ASIP) 278, aFast Fourier Transform (FFT) processing device 280, etc. Further, partof the applications may be run on analog electronic devices that may beincluded in the computing device 200. Other resources, such as, forexample, GPU 290, may also be used to run part of the applications.

The storage 215 may contain software tools for applications. The storage215 may include code 250 for the operating system (OS) of the device200, code 255 for applications running on the operation system includingthe applications for the interface 110, the textual interface 130, theexecution engine 140, the code generating tool 150, the reportgenerating tool 160, and/or one or more programmable APIs 170 and data260 generated from the interface 110, the textual interface 130, theexecution engine 140, the code generating tool 150, the reportgenerating tool 160, one or more programmable APIs 170, and/or othercode. Portions of applications may be stored in the CPU cache 207,memory 210, and/or elsewhere, such as on a remote storage deviceconnected to computing device 200 via a network, a bus, a dedicatedlink, etc.

The input control 220 may interface with a data entry device, such as akeyboard 240, a pointing/indexing device, such as a mouse 242, amicrophone 244, a camera 246, such as a web camera, and/or other inputdevices. The computing device 200 may receive, through the input control220, input data, such as the input data for developing graphical model112. The computing device 200 may display on the display 235 userinterfaces for displaying the data generated from the interface 110, thetextual interface 130, the execution engine 140, the code generatingtool 150, the report generating tool 160, and/or one or moreprogrammable APIs 170.

FIG. 3 is an exemplary network environment 300 (hereinafter environment300) suitable for processing distributed implementations of theexemplary embodiments. Environment 300 may include one or more servers320/350 coupled to clients 330/340 via a communication network 310. Inone implementation, servers 320/350 and/or clients 330/340 can beimplemented via the computing device 200. The network interface 230 andthe modem 225 of the computing device 200 enable the servers 320/350 tocommunicate with the clients 330/340 through the communication network310.

The communication network 310 may include Internet, intranet, Local AreaNetwork (LAN), Wide Area Network (WAN), Metropolitan Area Network (MAN),wireless network (e.g., using IEEE 802.11, Bluetooth, etc.), etc. Thecommunication network 310 may use middleware, such as Common ObjectRequest Broker Architecture (CORBA) or Distributed Component ObjectModel (DCOM) to allow a computer (e.g., client 320) on the communicationnetwork 310 to communicate directly with another computer or device(e.g., client 330) that is connected to the communication network 310.In addition, the communication network 310 may use RMI (Remote MethodInvocation) or Remote Procedure Call (RPC) technology. RMI and RPI areexemplary technologies that allow functions, methods, procedures, etc.,to be called over the environment 300. For example, the client 330 mayinvoke a method that resides remotely on the client 340.

In environment 300, the servers 320/350 may provide the clients 330/340with software components or products under a particular condition, suchas a license agreement. The software components or products may includethose for providing the interface 110, textual interface 130, theexecution engine 140, the code generating tool 150, the reportgenerating tool 160, one or more programmable APIs 170, etc. Forexample, the client 340 may perform the modeling of a dynamic systemusing a software component provided by the server 320 and send theserver 320 the model for execution. The server 320 may return theexecution results to the client 340 and the client 340 may subsequentlydisplay the data to the user with the information on the data.

FIGS. 4A-C depict a flow diagram that illustrates exemplary processingtechniques that can be used to perform traceability operations betweenthe graphical model 112, generated code, and/or an IR generated from thegraphical model 112. A user can generate the graphical model 112 in theenvironment 100 (step 400). The graphical model 112 that is generatedmay be executable in the environment 100 and may represent a graphicalmodel of a system, such as a dynamic system. In one implementation, thegraphical model 112 can be represented by a source model language, suchas, for example, Simulink® software.

In some instances, the user may not specify all of the parameters of thegraphical model 112. For example, the user may not specify values forsome parameters in the graphical model 112, such as a sample time ordata type. These parameter values can be inferred by the environment100. For example, the parameter values of a graphical affordance (e.g.,element 118) may be inferred from other graphical affordances (e.g.,elements 114 and 116) in the graphical model 112. Inferences, such asthese, may occur when the parameter values of the other graphicalaffordances are specified or the other graphical affordances have accessto a graphical affordance that has the specified parameter values. Inthis manner, a graphical affordance that has an unspecified parametermay inherit one or more parameters from another graphical affordancethat is associated with the graphical affordance. Such inferences mayoccur using a technique referred to as “propagation” or by solving aconstraint satisfaction problem using, for example, optimizationtechniques. Inferences may further occur using other techniques.

The code generating tool 150 can generate one or more IRs from thegraphical model 112 and can generate code that corresponds to thegraphical model 112 (step 405). The code generating tool 150 convertsthe source model language that represents the graphical model 112 into atarget language (i.e., generated code). For example, the code generatingtool 150 may generate code in a programming language, such as C, C++,JAVA®, Javascript, an assembly language, etc., or the code generatingtool 150 may generate code in a hardware description language, such asVerilog, VHDL, etc. The generated code may be stored in multiple files,such as in a header file, a source file, etc. The IRs and generated codemay be generated using transformation rules that may exist in a file,database, repository, etc. The transformation rules may be implementedusing graph grammar, triple graph grammar or any other order of graphgrammar.

The generated code may be compiled and executed external to theenvironment 100. For example, in one implementation generated code maybe compiled and executed on a target processor to implement thefunctionality of the graphical model 112.

The segments in generated code and/or portions of the IRs can bebi-directionally mapped to graphical affordances in the graphical model112 to associate the segments in generated code and/or portions of theIRs with aspects of the graphical model 112 and vice versa (step 410).Graphical affordances in the graphical model 112 that are translatedinto the IRs and/or generated code can be referenced within the IRsand/or generated code with a tag, association, etc. For example, a tag,association, etc., may be a hyperlink or another type of selectableconnection for navigating between mapped entities (e.g., the graphicalmodel 112, an IR, generated code, a generated report, a requirementsdocument, etc.).

A common form of selectable connection is hyperlinked text or graphicsthat can be selected by the user (with a pointing device, data entrydevice or in some other fashion), resulting in the immediate deliveryand/or view of another file. For example, hyperlinked text in generatedcode (e.g., a code segment in generated code) can be selected and acorresponding graphical affordance in the graphical model 112 can bedisplayed. Alternatively, a hyperlinked graphic in the graphical model(e.g., a graphical affordance, such as an element 114 or a signal) canbe selected and a corresponding segment in generated code can bedisplayed. In the case where a hyperlink is used, a selection may bemade, for example, by left-clicking with a pointing device or thehyperlink may simply be activated when the pointing device is positionedover the hyperlink.

In addition, where transformation rules are used to generate the IRand/or generated code, the mapping may include a map to and between thegraphical model 112 and the IR; the IR and generated code; the graphicalmodel 112 and generated code; etc. In this case, generation of the IRand/or the code may be predicated on the existence of the transformationrules. The mapping may allow a user to identify the transformation rulesthat are used when generating the IR and/or generated code.

The report generating tool 160 can generate a report that mayincorporate generated code and/or mappings between generated code andthe graphical model 112. The generated report may further include, forexample, sections corresponding to information on different elements114, 116 and/or 118 of the graphical model 112, a coverage report, acode generation report, a profiling report, etc. The same tagsassociated with generated code can be used for mapping sections of thegenerated report to aspects of the graphical model 112, generated code,and/or the IR. The same tags that are embedded in generated code or thegenerated report can be stored as part of the data structuresrepresented by the elements 114, 116, and/or 118 in the graphical model112.

If the user wishes to identify a graphical affordance that correspondsto a portion of the IR and/or a segment of generated code (step 412),the user can browse the IR or generated code to identify portions (e.g.,a graphical affordance, such as element 114) of the graphical model 112(step 415) (FIG. 4B). Upon selecting a portion of the IR or a segment ingenerated code, graphical affordances (e.g., element 114) of thegraphical model 112 that are associated with the selected portion of theIR or segment in generated code can be graphically identified (step420). Where transformation rules were used and there is a mapping to thetransformation rules, the transformation rules that are associated withthe selected portion or segment may also be graphically identified.

Alternatively, if the user does not wish to identify graphicalaffordance (step 412), but rather wishes to identify portions of the IRor segments of generated code that correspond to graphical affordances,the user can select graphical affordances (e.g., elements 114, 116and/or 118) of the graphical model 112 to identify correspondingportions of the IR or segments of generated code (step 425) (FIG. 4C).Upon selecting a graphical affordance in the graphical model 112,portions of the IR or segments of generated code that are associatedwith the selected graphical affordance can be graphically identified(step 430). For example, the segments of generated code can behighlighted. Again, where transformation rules were used and thetransformation rules were mapped, the transformation rules that areassociated with the selected graphical affordance may be graphicallyidentified.

In another embodiment, the user may execute the graphical model 112 togenerate data. The generated data may be mapped to the portion of thegraphical model 112 that was used to generate data. The mapping canprovide tags or associations that relate the data to the graphical model112 and can allow a user to identify the portion of the graphical model112 that corresponds to the generated data. For example, a user canexecute the graphical model 112 and the element 114 can generate asignal that is retained as generated data. The generated data can bedisplayed to a user with a centralized data viewer. The user may selectthe data and the element 114 in the graphical model 112 may be graphicalidentified.

Graphical identifiers, as discussed herein, provide a user with a way todiscern those parts the entities (e.g., segments of generated code,graphical affordances of the graphical model 112, sections of agenerated report or requirements document, portions of an IR, etc.) thatcorrespond to each other. For example, to graphically identify a segmentin generated code, a section in the generated report or graphicalaffordance in the graphical model 112, the segment, section or graphicalaffordance may be highlighted, change color, flash, etc.; or may becomeunderlined, italicized, bolded, etc. A segment, section or graphicalaffordance may further be encompassed by a shape such as a rectangle,square, circle, oval, etc., and the border of the shape may be any colorto aid in graphical identification. The interior of the shape may beshaded in a color or pattern according to exemplary embodiments. Thegraphical identifier may also be represented by an arrow or any othertype of marker that can graphically identify the segment, section orgraphical affordance to a user.

In another embodiment, a graphical identifier may be a window thatdisplays the segments of generated code, the sections of the generatedreport or requirements document, or portions of the IR that correspondto the graphical model 112. For example, the user can select the element114 in the graphical model 112 and the environment 100 can copy segmentsof generated code into a separate window that allows the user to viewthe segments of generated code that correspond to the element 114.

FIGS. 5A-D illustrate an implementation used to show a graphical model500, generated code 550 and/or a generated report 580. In oneimplementation, the generated report 580 may be optionally generated;and in another implementation, the generated report 580 may be requiredfor some activities or all activities. The graphical model 500 can be amodel of a system and can include an element 502. Generated code 550 canbe generated using a generate code option 510 (hereinafter option 510)and can include a segment 551 and a segment 555. The generated report580 can incorporate a listing 592 of generated code 550. Generated code550 or generated report 580 can be displayed to allow the user toinspect generated code 550 or generated report 580.

The generated report 580 may include a title 582, a summary section 584,an options section 586, a generated files section 588, a model settingssection 590 and a listing section 592 of generated code 550. The title582 provides a heading for the generated report 580. The summary section584 may provide information as to particular versions of softwareapplications that were used for the generated report 580, generated code550 and/or the graphical model 500 as well as information pertaining towhen the generated report 580 and/or generated code 550 were generated.The options section 586 provides information pertaining to variousaspects that have been specified for code generation, such as in whichlanguage generated code 550 is generated. The generated files section588 provides information pertaining to code files that were generated asa result of the code generation process. The model settings section 590provides information pertaining to model settings, such as, for example,execution parameters. The listing section 592 provides listings of thegenerated code 550 that is generated from the graphical model 500 andmay include a section 581 and a section 585.

Information included in a generated report 580 may vary. The generatedreport 580 may include more or less information than what is depicted inthe generated report 580. For example, the generated report 580 mayinclude a section that lists optimizations performed while generatinggenerated code 550, such as expression folding, loop unrolling, functioninlining, function outlining, constant propagation, etc. In addition,the generated report 580 can include information pertaining to executionwarning, memory usage, compile time (that may be represented per fileand/or as a total compile time), etc. In one implementation, formats ofthe generated report 580 may vary. For example, the generated report 580may be a word processing document, a mark-up language document, aspreadsheet document, etc.

By selecting an element in the graphical model 500, segments ofgenerated code 550 and/or sections of the generated report 580 can begraphically identified. For example, referring to FIG. 5B, the user canselect the element 502 to identify segments 551 and 555 in generatedcode 550 and sections 581 and 585 in the generated report 580 usinggraphical identifiers 557 and 587, respectively. In some instances, thegraphical identifier 557 and the graphical identifier 587 can beidentical. When the graphical identifiers 557 and 587 are identical, itmay provide an indication to the user that the sections 581 and 585correspond to the segments 551 and 555 as well as to the element 502.The user may select an element 502 in the graphical model 500 by movinga pointing device 505 over the element 502 in the graphical model 500.In one implementation, the user can position the pointing device 505 onthe element 502 in the graphical model 500 and the associated segments551 and 555 of generated code 550 and/or the associated sections 581 and585 of the generated report 580 are graphically identified. In anotherimplementation, the user may select the element 502 in the graphicalmodel 500 to identify segments 551 and 555 of generated code 550 and/orsections 581 and 585 of the generated report 580 by clicking on theselected element 502 in the graphical model 500.

In another embodiment, the segments 551 and 555 of generated code 550and/or the sections 581 and 585 of the generated report 580 may depictedin a window 570, as shown in FIG. 5C. The user may have the graphicalmodel 500, generated code 550 and generated report 580 and may wish toidentify the segments 551 and 555 that correspond to the element 502.The user may select the element 502 and the separate window 570 can beopened to display only the segments 551 and 555. To display only thesegments 551 and 555, the environment 100 may copy the segments 551 and555 into the window 570. The window 570 can be used to display otherparts of other entities (e.g., sections 581 and 585 of the generatedreport 580, sections of a requirements document, portions of an IR,etc.) using the same mechanism.

FIG. 6A is discussed with references to FIGS. 5A-C and is a flow diagramillustrating steps for graphically identifying the segments 551 and 555of generated code 550 or the sections 581 and 585 of the generatedreport 580 based on selecting the element 502. To begin, a user cangenerate the graphical model 500 that includes the element 502 (step600). The user can generate code 550 corresponding to the graphicalmodel 500 by selecting the option 510 (step 605). Optionally, the usercan generate the generated report 580 that incorporates the listing 592of generated code 550 and the associated mapping (step 610). The usercan identify the segments 551 and 555 of generated code 550 or thesections 581 and 585 of the generated report 580 that are associatedwith the element 502 by selecting the element 502 (step 615). When theuser selects element 502, the segments 551 and 555 of generated code 550or the sections 581 and 585 of the generated report 580 that areassociated with the element 502 are graphically identified by graphicalidentifiers 557 and 587, respectively (step 620).

In some instances, a graphical affordance may be mapped to multiplesegments of generated code 550 or sections of the generated report 580based on the various aspects of the graphical affordance. For example,referring to FIG. 5D, when the user selects the element 502 segments 551and 555 and/or sections 581 and 585 can be uniquely identified. Segment551 can be identified by a graphical identifier 591 and segment 555 canbe identified by a graphical identifier 595. In addition, section 581can be identified by the graphical identifier 591, thereby, identifyingto the user that the section 581 corresponds to the segment 551 as wellas the element 502. Likewise, section 585 can be identified by thegraphical identifier 595, thereby, identifying to the user that thesection 585 corresponds to the segment 555 as well as the element 502.

FIG. 6B is discussed in relation to FIGS. 5A and 5D and is a flowdiagram that illustrates exemplary steps for uniquely identifyingsegments 551 and 555 of generated code 550 or sections 581 and 585 ofthe generated report 580 based on corresponding aspects of the element502. In one implementation, the various aspects of the graphicalaffordance can be uniquely identified in generated code 550. The usercan select the element 502 (step 650) and segment 551 of generated codethat corresponds to one of the various aspects 501, such as an outputvariable of the element 502 can be uniquely identified by graphicalidentifier 591 (step 655), while segment 555 (FIG. 5C) of generated code550 that corresponds to an output of the element 502 can also beuniquely identified by graphical identifier 595 (step 660).

In some embodiments, the user may want to limit segments of generatedcode 550 or sections of the generated report 580 that are graphicallyidentified. For example, the user may only want to identify the segment551 of generated code 550 or section 581 of the generated report 580that relates to one of the various aspects 501, such as an outputvariable of the element 502 in the graphical model 500.

FIG. 7 is an example of a menu 700 that allows the user to specifysegments of generated code 550 or sections of the generated report 580that the user wishes to identify and/or with which the user wishes tointeract. A user may right click on the graphical model 500 to open menu700. In an alternative implementation, a user may select the “Tools”button from the menu bar 520. The menu 700 provides an “Inspect code”option 702 that allows a user to specify which segments of generatedcode 550 that are graphically identified when an element in thegraphical model 500 is selected. For example, when the user selects the“Inspect code” option 702, a submenu 710 may be displayed that allowsthe user to select which segments of generated code 550 that aregraphically identified.

The submenu 710 can include, for example, a “Block output” option 712,an “Input variables” option 714, an “Output variables” option 716 and a“Block parameters” option 718. When the user selects the option 712,segments of the generated code 550 or sections of the generated report580 that correspond to the output of a selected element are graphicallyidentified. When the user selects option 714, segments of generated code550 or sections of the generated report 580 that correspond to inputvariables of a selected element are graphically identified. When theuser selects option 716, segments of generated code 550 or sections ofthe generated report 580 that correspond to output variables of aselected element are graphically identified. When the user selectsoption 714, segments of generated code 550 or sections of the generatedreport 580 that correspond to element parameters of a selected elementare graphically identified.

FIG. 8 depicts the graphical model 500, generated code 550 and thegenerated report 580 discussed with reference to FIG. 5A. As discussedwith reference to FIG. 5A, the graphical model 500 can be a model of asystem and can include an element 502. Generated code 550 can begenerated using the option 510 and include segments 551 and 555. Thegenerated report 580 can incorporate a listing 592 of generated code 550and can include sections 581 and 585. Generated code 550 or generatedreport 580 can be displayed to allow the user to inspect generated code550 or generated report 580.

Referring to FIG. 8, the element 502 in the graphical model 500 can havevarious aspects 501, such as an output variable 503 that is associatedwith the element 502. Some examples of other various aspects may besignal names, outputs, input variables, element parameters, outputvariables, etc. Generated code 550 can have the segment of code 551and/or generated report 580 can have the section 581 that corresponds toone of the various aspects 501, such as an output variable 503.Referring to FIG. 8, when the user selects the element 502 the segment551 and section 581 can be graphically identified by a graphicalidentifier 860 and an identifier 867, respectively. In some instances,the graphical identifier 860 and the graphical identifier 867 can beidentical to indicate to the user that the section 581 corresponds tothe segment 551 as well as to the output variable 503 of the element502.

FIG. 9 is a flow diagram that illustrates exemplary steps forgraphically identifying the segment 551 of generated code 550 or thesection 581 of the generated report 580 associated with one of thevarious aspects 501, such as the output variable 503, of the element 502in the graphical model 500. The flow diagram of FIG. 9 is discussed withreference to FIGS. 7 and 8. Referring to FIG. 7, the user may indicatethat only output variables should be identified in generated code 550 orgenerated report 580 by selecting option 716 (step 900). Referring toFIG. 8, the user can select the element 502 in the graphical model 500(step 905). Only segment 551 and section 581 that correspond to outputvariable 503 are graphically identified by graphical identifiers 860 and867, respectively (step 910). In this manner, a user can specify a scopeof graphical affordances that can be selected. For example, a user canselect to identify segments of generated code 550 or sections of thegenerated report 580 that correspond to various aspects (e.g., variousaspects 501 of an element (e.g., element 502) a single element, multipleelements, a signal, parameters or any other graphical affordance of thegraphical model 500.

FIG. 10 is an example of a graphical representation for depicting thegraphical identification of a graphical affordance in the graphicalmodel 500. As discussed with reference to FIG. 5A, the user can generatethe graphical model 500 and can generated code 550 that corresponds tothe graphical model 500. Optionally, the generated report 580 can begenerated. The generated report 580 can incorporate a listing 592 ofgenerated code 550. Generated code 550 or generated report 580 can bedisplayed to allow the user to inspect generated code 550 or generatedreport 580.

The user can select the segment 551 of generated code 550 or the section581 of the generated report 580. Upon selection of the segment 551 orthe section 581, the element 502 that corresponds to the segment 551 orsection 581 is graphically identified by a graphical identifier 1090. Incertain instances, the segment 551 or section 581 may be a hyperlinked.For example, the segment 551 may have a hyperlink 1051 and section 581may have a hyperlink 1081. The user may select hyperlink 1051 or 1081 tographically identify the element 502 that corresponds to the segment 551or the section 581 using a graphical identifier 1090.

FIG. 11A is a flow diagram illustrating steps for graphicallyidentifying graphical affordances in a graphical model 500 thatcorrespond to selected segments of generated code 550 or sections of thegenerated report 580. The user can select the segment 551 in generatedcode 550 or the section 581 in the generated report 580 (step 1100).Upon the selection, graphical affordances (e.g., element 502) of thegraphical model 500 that are associated with the segment 551 ofgenerated code 550 or the section 581 of the generated report 580 aregraphically identified. The user can select the segment 551 of generatedcode 550 or the section 581 of the generated report 580 using the textcursor such that when the text cursor is on the segment 551 in generatedcode 550 or the section 581 in the generated report 580, the associatedgraphical affordance (e.g., element 502) in the graphical model 500 isgraphically identified. Alternatively, generated code 550 and generatedreport 580 may contain navigable connections, such as hyperlinks 1051and 1081, that allow the user to select the segment 551 in generatedcode or the section 581 in the generated report 580 by clicking on thesegment 551 or section 581 with a pointing device 505 or by simplypositioning the pointing device 505 over the segment 551 or the section581. For example, when the user selects a segment 551 of generated code550 (step 1105), the element 502 is graphically identified by graphicalidentifier 1090 (step 1110).

In the case where hyperlinks (e.g., hyperlinks 1051 and 1081) areprovided in generated code 550 or the generated report 580, thehyperlinks (e.g., hyperlinks 1051 and 1081) may be provided for onlycertain segments of generated code such as variables, operators,comments, etc. Alternatively, hyperlinks can be provided for allsegments in generated code.

In some instances, a segment in generated code 550 may be mapped tomultiple graphical affordances in the graphical model 500. FIG. 11B is aflow diagram that illustrates identifying multiple graphical affordancesbased on a corresponding segment using a unique identifier for eachgraphical affordance that is identified. The user can select a segmentin generated code 550 (step 1150) and multiple graphical affordances canbe graphically identified such that each graphical affordance may have aunique graphical identifier (step 1155).

In some embodiments, the user may want to limit the graphicalaffordances that are graphically identified. For example, the user mayonly want to identify a graphical affordance that relates to an outputsignal of an element in the graphical model 500. To achieve this, theuser may be provided with menus that are substantially similar to themenus 700 and 710. For example, the menus may provide options that allowa user to specify a scope of graphical affordances in the graphicalmodel 500 that are graphically identified when a segment in generatedcode 550 is selected.

FIG. 11C is a flow diagram that illustrates the steps for graphicallyidentifying a portion of a graphical model 500 that is associated with asegment in generated code 550. The user can indicate that output signalsof the graphical model 500 should be graphically identified (step 1180).The user can select a segment of generated code 550 or a section of thegenerated report 580 (step 1185) and output signals in the graphicalmodel 500 that are associated with the segment are graphicallyidentified in generated code 550 or generated report 580 (step 1190).

FIG. 12 depicts an exemplary graphical model 1200, generated code 1250that corresponds to the graphical model 1200, and a requirementsdocument 1280. The graphical model 1200 includes a user-specifiedelement 1202 (hereinafter element 1202). The element 1202 can representcode and can be developed using the textual interface 130, an externalcode browser, or any application that allows a user to develop textualcode. The element 1202 can represent, for example, an S-Function thatdescribes behavioral aspects of the user specified element; an EmbeddedMATLAB block that can be developed using the technical languageMATLAB.RTM.; custom code that can be developed in a programminglanguage, such as C, C++, JAVA®, Javascript, an assembly language, etc;etc.

The element 1202 can have an interface 1204 that allows other elementsin the graphical model 1200 to connect to the element 1202. Theinterface 1204 can include an input 1212, an output 1214 and a trigger1216. The interface 1204 may also accept global data to allow theelement 1202 to read, write and/or process data that is availablethroughout the graphical model 1200. The global data, for example, canbe stored in a global data store element 1206 (hereinafter element1206). The input 1212 allows the element 1202 to receive signals fromanother element in the graphical model 1200. The output allows theelement 1202 to output signals. The output signals can be determined bythe execution of the code associated with the element 1202. For example,the element 1202 may call a function that performs a specified operationwhen the element 1202 executes. The trigger 1216 allows the element tobe selectively executed. For example, the element 1202 may not executeunless it receives a trigger signal. The trigger signal may be receivedby the element 1202 from another element in the graphical model 1200 orfrom a location external to the graphical model 1200. The triggersignal, therefore, may enable the execution of the element and mayprovide for conditional execution of the element 1202.

The user may develop the element 1202 based on a requirement 1282 in therequirements document 1280. The requirements document 1280 may be storedon the computing device 100 (FIG. 1) or remotely in the networkenvironment 200 (FIG. 2). The requirements (e.g., requirement 1280) maybe hierarchical such that a requirement may have sub-requirements, whichin turn also may have sub-requirements. The requirements and/orsub-requirements can be graphically identified. In one example, theelement 1202 that was developed based on the requirement 1282 can bemapped to the requirement 1282 to allow for the graphical identificationof the requirement 1282 upon the selection of the element 1202 or toallow graphical identification of the element 1202 based on theselection of requirement 1282. In one implementation, the element 1202may include a hyperlink 1220 that corresponds to the location in therequirements document 1280 that contains requirement 1282. When the userselects the hyperlink 1220, the requirement 1282 is graphicallyidentified by graphical identifier 1295.

Generated code 1250 can be generated from the graphical model 1200 andcan include segments that correspond to the element 1202 and theinterface 1204 of the element 1202. The generated code may alsocorrespond to the requirements document 1280. In one example, theelement 1202 can represent a function such that the interface 1204 ofthe element 1202 can be transformed into a generated function interfacein generated code 1250. In this example, the interface 1204 can bemapped to a function interface 1252 in generated code 1250. The functioninterface 1252 can include a segment 1254, a segment 1256, a segment1258 and a segment 1260. The segment 1254 of generated code 1250 can mapto the trigger 1216. The segment 1256 of generated code 1250 can map tothe input 1212. The segment 1258 of generated code 1250 can map to theoutput 1214. The segment 1260 of generated code 1250 can map to element1206. A segment 1262 of generated code 1250 defines formal arguments tobe used by the function in generated code 1250. The segments 1254, 1256,1258 and 1260 of generated code 1250 can each correspond to an argumentin the segment 1262.

Segments (e.g., segments 1254, 1256, 1258, 1260, 1262, etc.) ofgenerated code 1250 or graphical affordances (e.g., element 1202,element 1206, interface 1204, input 1212, output 1214, a trigger 1216,etc.) of the graphical model 1200 can be graphically identified inaccordance with embodiments discussed herein. For example, a user canselect the element 1202 and segments (e.g., segments 1254, 1256, 1258,1260, 1262, etc.) in generated code 1250 can be graphically identified.Likewise, the user can select a segment in generated code 1250 tographically identify a graphical affordance (e.g., element 1202) in thegraphical model 1200. In addition, a user can specify a scope thatlimits the graphical identification to certain aspects of generated code1250 or the graphical model 1200. For example, the user can specify thatonly generated code 1250 relating to the output 1214 is to begraphically identified. In this example, when the user selects theelement 1202, the segments 1258 and 1262 can be graphically identified.

The mapping of the interface 1202 to the function interface 1252 allowsa user to graphically identify segments (e.g., 1254, 1256, 1258, 1260)of generated code 1250 that correspond to an element interface (e.g.,interface 1204) in the graphical model 1200. This provides the user withthe ability to a identify the segments 1254, 1256, 1258, 1260, 1262,etc., of generated code 1250 that correspond to the interface 1204 ofthe element 1202, where the interface 1204 of the element 1202corresponds to the function interface 1252 in generated code 1250 thatis represented by a unique list of memory locations accessed in thefunction, but which are defined by (or exist in the scope of) the parent(call-site) of the function.

In some instances, code that is specified in a user specified element(e.g., element 1202) may represent code developed in the same languageas the target language (e.g., generated code 1250). For example, a usermay develop code for a user specified element (e.g., element 1202) inthe programming language of C and the user may wish to generate code(e.g., generated code 1250) in the programming language of C. In thisexample, generated code (e.g., generated code 1250) can incorporate thecode of the user specified element (e.g., element 1202) withoutmodification. The code of the user specified element (e.g., element1202) may also be incorporated into generated code (e.g., generated code1250) with modification. For example, the code of the specified element(e.g., element 1202) can be optimized using optimizations such as,inlining, outlining, loop unrolling, etc. In another instance, a userspecified element (e.g., element 1202) can be developed using abehavioral description. In this instance, generated code (e.g.,generated code 1250) from the graphical model (e.g., graphical model1200) does not correspond directly to the behavioral description of theuser specified element (e.g., element 1202). When the code of a userspecified element (e.g., element 1202) is not developed in the samelanguage as the intended target language, code of the user specifiedelement (e.g., element 1202) can be converted into the target language(e.g., generated code 1250).

The environment 100 allows the user to graphical identify segments ofgenerated code (e.g., generated code 1250) that corresponds to a userspecified element (e.g., element 1202). The environment 100 mayimplement one of the programmable APIs 170 to perform the graphicalidentifying between the user specified element (e.g., element 1202) andthe segments (e.g., segments 1254, 1256, etc.) of the generated code(e.g., generated code 1250).

The mapping and graphical identification of user specified elements(e.g., element 1202) and corresponding segments (e.g., segments 1254,156, etc.) of generated code (e.g., generated code 1250) can beperformed in the same manner as discussed with reference FIG. 4-11C andthe mapping can be utilize tracing information, which is discussed inmore detail below. The user may select segments (e.g., segments 1254,1256, etc.) of generated code (e.g., generated code 1250) or a userspecified element (e.g., element 1202) in the same manner as discussedwith regard to FIGS. 4-12 to graphical identify segments (e.g., segments1254, 1256, etc.) relating to a user specified element (e.g., element1202) or to graphically identify a user specified element (e.g., element1202) that is related to segments (e.g., segments 1254, 1256, etc.) ofgenerated code (e.g., generated code 1250). Alternatively, one of theprogrammable APIs 170 can allow the user to specify a mapping betweenthe user specified element (e.g., element 1202) and generated code(e.g., generated code 1250).

A user may specify design requirements (e.g., requirement 1282) for eachelement (e.g., element 1202) or signal of a system to be represented bya graphical model (e.g., graphical model 1200). The design requirements(e.g., requirement 1282) can be used to develop a graphical model (e.g.,graphical model 1200) according to specifications that identify, forexample, performance parameters of the system to be modeled by thegraphical model (e.g., graphical model 1200). In one implementation, thedesign requirements (e.g., requirement 1282) can be provided in arequirements document (e.g., requirements document 1280). Therequirements document (e.g., requirements document 1280) may take anyform, such as, for example, a word processing document, a spreadsheet, amark-up language document, such as an eXtensible Markup Language (XML)file, hardcopy document, verbal conveyed specifications, recordedspecifications, etc.

FIG. 13A is a flow diagram that illustrates a mapping between therequirements document 1280 and the graphical model 1200. When the userdevelops a graphical model 1200 based on requirements in therequirements document 1280, the requirement 1282 can be mapped to theelement 1202 in the graphical model 1200. For example, a user mayspecify the element 1202 based on a section (i.e., requirement 1282) ofthe requirements document 1280 (step 1300). The user can include, in theelement 1202, a location in the requirements document 1280 thatcorresponds to the element 1202 (step 1305). For example, when therequirements document 1280 is a document that supports hyperlinks, theuser can insert a hyperlink 1220 into the element 1202 of the graphicalmodel 1200. The hyperlink 1220 may associate the element 1202 with thecorresponding section (i.e., requirement 1282) in the requirementsdocument 1280. When the user selects the element 1202 (step 1310), thesection (e.g., requirement 1282) of the requirements document 1280 thatis associated with the element 1202 can be displayed and graphicallyidentified by graphical identifier 1295 (step 1315).

FIG. 13B is a flow diagram that illustrates the mapping between arequirements document 1280 and generated code 1250 (or a generatedreport) from the graphical model 1200. The user can generate code 1250from the graphical model 1200 (step 1320) and the generated code 1250can include associations (or links) to the requirements document 1280(step 1325). In this manner, a user may identify design requirements(e.g., requirement 1282) in the requirements document 1280 thatcorrespond to selected segments of generated code 1250. For example,after generating code 1250, the user can select segments of generatedcode 1250 (step 1330) and sections (e.g., requirement 1282) of therequirements document 1280 associated with the segments (e.g., segments1254, 1256, etc.) of generated code 1250 can be displayed andgraphically identified (step 1335).

When a user selects a graphical affordance (e.g., element 1202) in thegraphical model 1200 or a segment (e.g., segment 1254) of generated code1250 that is associated with a section (e.g., requirement 1282) of therequirements document 1280), the sections (e.g., requirement 1282) ofthe requirements document 1280 can be displayed and may also beidentified graphically. Further, if the user selects a segment (e.g.,segment 1254) of generated code 1250 both the corresponding graphicalaffordance (e.g., element 1202) in the graphical model 1200 and thecorresponding section (e.g., requirement 1282) of the requirementsdocument 1280 can be graphically identified. Conversely, when the userselects a graphical affordance (e.g., element 1202) of the graphicalmodel 1200 both the corresponding segments (e.g., segments 1254, 1256,etc.) of generated code 1250 and the corresponding section (e.g.,requirement 1282) of the requirements document 1280 can be graphicallyidentified.

In some instances, additional information concerning the original designand any intermediate artifacts, such as, but not limited to, output datatypes, input data types, saturation mode, sample time, execution order,etc., can be mapped between a graphical model and/or generated code andcan be included in the tracing information. Additional information canbe specified by the user or may be inferred by the environment 100. Inone implementation, the additional information may not be readilyvisible in the model (i.e., undisplayed). Such additional informationmay relate to parameters of the graphical model, such as executionparameters or graphical affordance parameters. While additionalinformation may be important for implementation of a graphical model,the additional information may not be necessary for a user to determinethe basic structure and function of the graphical model. To avoidcluttering the graphical model this additional information may not bedisplayed (i.e., undisplayed) in the graphical model.

The additional information may also be hidden elements (i.e.,undisplayed elements) that are inserted into the graphical model. Forexample, the environment 100 can automatically insert rate-transitionelements, which are not displayed, into a graphical model for execution.A rate-transition element may be automatically inserted by theenvironment when a first element has a sample rate and an elementconnected to that element has another sample rate. The rate transitionelement allows the two elements to interface with each other byconverting the sample rate of the first element to match the sample rateof the element connected to the first element. The rate transitionelement allows two elements that are connected to each other to havedifferent sample rates. Undisplayed information that consists of hiddenelements is incorporated into generated code. When a user is viewing thecode, the user may not know where the hidden elements are in thegraphical model. By providing a mapping between the code and the hiddenelements, the hidden elements that correspond to segments of generatedcode can be graphically identified.

FIG. 14A is a diagram showing an exemplary technique for overlayingadditional information 1490 associated with the graphical model 500 andgenerated code 550. The graphical model 500 and generated code 550 adisplay using the environment 100, which in this case is an integratedenvironment that utilizes a MDI application to enable simultaneousviewing of the graphical model 500 and generated code 550. Theadditional information 1490 is incorporated in the graphical model 500,but is undisplayed in the graphical model 500. The additionalinformation 1490 may represent, for example, data type, sample time,delay, a hidden element, etc. In one example, a user may specify aninput to an element in the graphical model 500, but may not specify thedata type of an output. The environment 100 may use propagation todetermine what data type to use for the output. The user may want toview the additional information 1490 (e.g., the inferred output data inthis example) of the graphical model 500 that corresponds to a selectedsegment (e.g., segment 551) of generated code 550. The user can select asegment (e.g., segment 551) of generated code 550 corresponding to theadditional information 1490 and the additional information 1490 can bedisplayed by overlaying the additional information 1490 on the graphicalmodel 500 or generated code 550.

FIG. 14B is a flow diagram that illustrates exemplary steps forgraphically identifying additional information by overlaying theinformation on the graphical model 500 or generated code 550. Theundisplayed additional information 1490 in the graphical model 500 isincluded in generated code 550 (step 1400). The user selects a segment(e.g., segment 551) of generated code 550 corresponding to theadditional information 1490 to display the additional information 1490(step 1405). The additional information 1490 is displayed to the user(step 1410).

In some embodiments the tracing information between a graphical model(e.g., graphical model 500 or 1200) and generated code (e.g., generatedcode 1200 or 1250) can be output to an independent representation, suchas an independent file in a plain-text or binary format. The term“independent representation” as discussed herein refers to arepresentation can be used independent of the environment 100. In oneexample, the independent representation can be stored in a repository,database, other storage medium, etc., and may be represented as an XMLfile.

FIG. 15A depicts an example of a graphical model 1500 that includes aninput element 1502, a gain element 1504 and an output element 1506.Generated code that represents the graphical model 1500 can be generatedby the environment 100. FIG. 15B depicts exemplary generated code filesthat contain generated code from the graphical model 1500. Header file1520 may be a data structure, such as a file, that includes generatedcode according to one or more exemplary embodiments. Header file 1520can be used to define model data structures and/or a public interface tomodel entry points and/or data structures. Source file 1540 may be adata structure, such as a file, that include generated code according toone or more exemplary embodiments. Source code 1540 may containdeclarations for the parameters data structure and the constant blockI/0 data structure, and any zero representations for structure datatypes that are used in the graphical model 1500.

Tracing information between the graphical model 1500, generated code(e.g., the contents of header file 1520 and source file 1540),optionally generated report and optionally provided requirementsdocument can be stored in an independent representation. Exemplarycontents of an independent representation for providing tracinginformation between the graphical model 1500 and generated code in thecode files 1520 and 1540 may include the following:

<?xml version=“1.0” encoding=“ASCII” standalone=“yes”> <project><system_version> <application name=“MATLAB” version=“7.3”/> <applicationname=“Simulink” version=“6.5”/> ... </system_version> <modelname=“example.mdl” version=“1.0”> <model:settings> <model:parameter><model:parameter_name>Solver</model:parameter_name><model:parameter_value>ode3</model:parameter_value> </model:parameter>... </model:settings> <model:root> <model:block><model:block_type>Inport</model:block_type><model:block_name>In1</model:block_name><model:objectId>B_1</model:objectId> </model:block> <model:block><model:block_type>Gain</model:block_type><model:block_name>Gain</model:block_name><model:objectId>B_2</model:objectId> </model:block> <model:block><model:block_type>Outport</model:block_type><model:block_name>Out1</model:block_name><model:objectId>B_3</model:objectId> </model:block> </model> <codetarget=“c”> <code:header file_name=“example.h”> ... <code:segmenttype=“type definition”> <code:fragment start_line=“24”><code:content>typedef struct {</code:content> </code:fragment><code:fragment start_line=“25”> <code:content>real_TOut1;</code:content> <code:source>B_3</code_source> </code:fragment><code:fragment start_line=“26”> <code:content>}</code:content></code:fragment> </code:segment> </code:header> <code:sourcefile_name=“example.c”> ... <code:function> ... <code:segmenttype=“statement”> <code:fragment start_line=“10” start_col=“2”><code:content>example_Y.Out1 = </code:content><code:source>B_3</code_source> </code:fragment> <code:fragmentstart_line=“10” start_col=“19”><code:content>example_U.In1</code:content><code:source>B_1</code_source> </code:fragment> <code:fragmentstart_line=“10” start_col=“33”> <code:content>*example_P.Gain_Gain;</code:content> <code:source>B_2</code_source></code:fragment> </code:segement> ... </code:function> ...</code:source> ... </code> ... </project>

In the implementation illustrated above, the independent representationis provided in an XML format. Other implementations can use otherformats to provide the tracing information, and that the use of the XMLformat is merely one example of one format that can be employed toimplement the independent representation.

The environment 100 may allow a user to overwrite a mapping between agraphical model and generated code. For example, the user may access thetracing information and may edit the tracing information to provide adifferent mapping. The user may determine that a more detailed or lessdetailed mapping is necessary and the user may modify the mapping tocorrespond to a desired level of detail in the mapping.

In some embodiments, a deployable representation of a graphical model(e.g., graphical model 1500), generated code (e.g., the contents ofheader file 1520 and source file 1540) and tracing information can bedeveloped. A deployable representation is a representation that allows auser to access and view the graphical model (e.g., graphical model 1500)and/or generated code (e.g., the contents of header file 1520 and sourcefile 1540) external from the environment 100. The deployablerepresentation, therefore, allows a user to perform generated code(e.g., the contents of header file 1520 and source file 1540) andgraphical model (e.g., graphical model 1500) inspection independent ofthe environment 100. The deployable representation may be deployable ina web-based environment; a word processing environment, such a MicrosoftWord® document from Microsoft, Inc. of Redmond Wash.; an environment ona handheld device; etc. In on implementation, the deployablerepresentation may be a web deployable representation that can bedeployed in a web browser. An example of a web deployable representationcan be, for example, a hypertext mark-up file. The deployablerepresentation may use a scalable vector graphics (SVG) format to allowcontents of the representation to scale to the size of a display areawithout distortion.

FIG. 16A is an exemplary web browser 1600 that displays a web deployablerepresentation 1605 that allows a user to trace elements of thegraphical model to elements in generated code and vice versa. The webdeployable representation 1605 may include a hyperlinked representation1610 of the graphical model 1500, a hyperlinked representation 1620 ofthe code file 1520, a hyperlinked representation 1640 of the code file1540 and a hyperlink 1650 to the tracing information 1652 depicted inFIG. 16B.

The hyperlink representation 1610 includes hyperlinked elements. Forexample, gain element 1615 is a hyperlink that can be selected to allowthe user to graphical identify and view the section of the code filesthat correspond to the gain element or portions of the gain element.

The hyperlinked representation 1620 may also include hyperlinks forgraphically identifying and/or viewing portions of the hyperlinkedrepresentation 1610 and/or the hyperlinked representation 1640.Likewise, the hyperlinked representation 1640 may include hyperlinks forgraphically identifying and viewing portions of the hyperlinkedrepresentation 1610 and/or 1620. For example the hyperlinkedrepresentation 1640 may include a hyperlink 1645 that corresponds to thegain element 1615. When the user selects the hyperlink 1645, the gainelement is graphically identified.

The hyperlink 1650 to the tracing information 1652 allows a user tonavigate to the tracing information 1652 to view the mapping between thehyperlinked representations 1610, 1620 and 1640. FIG. 16B depicts a webbrowser 1655 that displays a portion of the tracing information 1652.The user may select the hyperlink 1650 (FIG. 16A) and the web browser1655 may be provided to display the tracing information 1652.

The implementation described above, with regard to FIGS. 16A-B, isrepresentative of one implementation, numerous other implementations ofdeployable representations are possible. Further, it will be recognizedthat the deployable representation may include a generated report, arequirements document or other types of information that can beassociated with the graphical model 1500 or generated code. Separatewindows may be provided for viewing the graphical model, generated code,generated report, requirements document, tracing information, etc.

In one alternative embodiment the graphical model and generated code maybe displayed using a heterogeneous dependency viewer. A heterogeneousdependency viewer allows a user to view a graphical model and generatedcode together using a dependency graph. A dependency graph showsdependency relationships of one or more entities (e.g., a graphicalmodel, generated code, generated report, etc.). An example of aheterogeneous dependency viewer is discussed in pending U.S. patentapplication Ser. No. 11/488,426 and is incorporated herein by reference.

In some instances, a user can generate a model coverage report from agraphical model or a code coverage report from generated code thatcorresponds to the graphical model. The model coverage report canprovide a certain level of testing that was performed on the graphicalmodel to assure that the graphical model meets certain specifications.This is achieved by implementing test cases using the graphical model.The code coverage report generally performs a similar operation forgenerated code, and therefore, assures that generated code meets certainspecifications. In some instances, model coverage is conducted beforedesign implementation (i.e. before generating code). Generally aftergenerated code is available, the user desires to know the code coverageto ensure that determined portions of the model/code are exercised(e.g., when test cases are run against the model/code).

In some embodiments, the user can combine the model coverage reportgenerated by applying test cases in the graphical model and the codecoverage report generated by applying test cases in generated code. Forexample, a user can convert the model coverage report into code coveragereport, or vice versa. The conversion from the model coverage report tothe code coverage report, or vice versa, can use the mapping between thegraphical model and generated code. By converting model coverage to codecoverage, the user can reduce the number of additional tests needed toachieve code coverage.

FIG. 17 is a flow diagram that illustrates exemplary steps forimplementing an external code browser and/or debugger with generatedcode. A code browser may be an application that allows a user to browsegenerated code and can be a code editor, a word processing applicationor another application that allows a user to view and/or browse code. Anexample of a code browser can be, for example, Microsoft Visual Studiofrom Microsoft, Inc. of Redmond Wash. Examples of external debuggers mayinclude, but are not limited to, Microsoft Visual Studio, or open sourcesoftware, such as the GNU's Not Unix (GNU) Debugger commonly referred toas GNU Debugger (GDB), etc.

Referring to FIG. 17, A user can develop a graphical model (e.g.,graphical model 500, 1200, etc.) (step 1700) and generate code (e.g.,generated code 550, 1250, etc.) that represents the graphical model(step 1705). Associations between the graphical model and generated codeare mapped to provide tracing information (step 1710). The tracinginformation is output to an independent representation (step 1715).

An external code browser and/or debugger can use the tracing informationand the one of the programmable APIs 170 to browse and/or debug thegraphical model and generated code (step 1720). The external codebrowser and/or debugger can be used to, for example, browse or debuggenerated code, while programmatically identifying the graphicalaffordances in the graphical model that correspond to the segments ofgenerated code that are being browsed and/or debugged (step 1725). Oneof the programmable APIs 170 may optionally provide graphicalidentifiers in generated code or on the graphical model to aid a user.

Alternatively, the external code browser and/or debugger can besynchronized with a graphical model editor and/or debugger that isprovided by the environment 100. Synchronizing the external browserand/or debugger allows a user can simultaneously browse and/or debug thegraphical model and generated code using, in part, an externalapplication. For example, as the user browses generated code with theexternal browser, corresponding graphical affordances in a graphicalmodel are graphically identified.

Exemplary embodiments enable round-trip editing. Round-trip editingallows a user to edit generated code to modify a graphical model andvice versa. FIGS. 18A-B depict part of a graphical model 1800 and asegment of generated code 1850 that can be generated from the graphicalmodel 1800 and used to illustrate round-editing. The part of thegraphical model 1800 includes a sum element 1805, an input 1810, aninput 1815 and an output 1820. The user can modify the addition operator1802 in generated code 1850 and the graphical model 1800 can beprogrammatically updated. For example, the user can change the operator1802 in generated code 1950 to be a multiplication operator 1804, asshown in FIG. 18B and the graphical model 1800 can be programmaticallyupdated such that the sum-element 1805 is replaced by a multiplicationelement 1825.

FIG. 18C depicts a graphical section of the graphical model 1800, wherethe segment of generated code 1850 that is generated from the graphicalmodel 1800 is a graphical model 1800′ that represents a modification ofthe graphical model 1800 and/or generated code 1850′ from the modifiedgraphical model 1800′. The environment 100 allows a user to generatecode 1850 from a graphical model 1800, modify the graphical model 1800to form graphical model 1800′ and repeat the code generation process togenerate code 1850′ such that generated code 1850 and generated code1850′ exist simultaneously. The environment 100 can compare generatedcode 1850 with generated code 1850′ to determine differences betweengenerated code 1850 and generated code 1850′. The environment 100 cangraphically identify a portion of the graphical model 1800′ that relatesto one or more differences between segments in generated code 1850 andgenerated code 1850′ using graphical identifier 1890 when the userselects the corresponding segment in generated code 1850 or 1850′.

In some embodiments, a user may be able to modify a portion of thegraphical model 1800 by right clicking on the segment of generated code1850 that maps to the portion of the element 1805 using a pointingdevice. FIG. 18D depicts the graphical model 1800, generated code 1850and a user interface 1890. When the user right clicks on the segment ofgenerated code 1850, the user interface 1890 can be displayed thatallows a user to specify aspects of the element 1805. The user interface1890 may be the same as a user interface that is provided to a user whena user is developing the graphical model 1800. The user interface 1890may include parameters 1891-1894. The parameters 1891-1894 may relate toaspects that are displayed in the graphical model or may relate toundisplayed aspects. The parameters may or may not affect the executionand functionality of the graphical model. The user interface 1890 mayallow a user to change the parameters of the element 1805. When the userchanges the parameters 1891-1894 in the user interface 1890, thegraphical model 1800 may be updated. In addition the segment ofgenerated code that is associated with the parameters 1891-1894 may alsobe updated. In another embodiment double clicking on a segment ofgenerated code may open up the user interface 1890.

FIG. 19 is a flow diagram that illustrates the steps for round-tripediting. A user can develop a graphical model 1800 (step 1900) and maygenerate code 1850 for the graphical model 1800 (step 1905). Tracinginformation is generated from a mapping between the graphical model 1800and generated code 1850 (step 1910). The user can edit generated code1850 or the graphical model 1800 (step 1915). Portions of the graphicalmodel 1800 or segments of generated code 1850 that correspond to theedits are updated (step 1920). This allows a user to edit generated code1850 and the graphical model 1800 with a minimal disturbance to thegraphical model 1800 or generated code 1850.

In addition, a user can use a search and replace operation for thegraphical model (e.g., graphical models 500, 1200, etc.) and/orgenerated code (e.g., generated code 550, 1250, etc.) to search forrecurring graphical affordances or segments to replace. FIG. 20A is aflow diagram that illustrates the steps for using the search and replaceoperation where the graphical model (e.g., graphical models 500, 1200,etc.) is searched. Once generated code (e.g., generated code 550, 1250,etc.) is generated from a graphical model (e.g., graphical models 500,1200, etc.), a user can search the graphical model (e.g., graphicalmodels 500, 1200, etc.) for a recurring graphical affordance, such as,for example, an element, a signal, etc. (step 2000). After the search isperformed, segments of generated code (e.g., generated code 550, 1250,etc.) can be graphically identified that correspond to the recurringgraphical affordance detected by the search (step 2005). The recurringgraphical affordance in the graphical model (e.g., graphical models 500,1200, etc.) can be replaced (step 2010) and the segments of generatedcode e.g., generated code 550, 1250, etc.) that correspond to therecurring graphical affordance can be updated to reflect the replacementof the recurring graphical affordance (step 2015).

FIG. 20B is a flow diagram that illustrates exemplary steps for usingthe search and replace operation where generated code (e.g., generatedcode 550, 1250, etc.) is searched. Once generated code (e.g., generatedcode 550, 1250, etc.) is generated from a graphical model (e.g.,graphical models 500, 1200, etc.), a user can search generated code(e.g., generated code 550, 1250, etc.) for a recurring segment (step2050). After the search is performed, portions of the graphical model(e.g., graphical models 500, 1200, etc.) that correspond to therecurring segment of generated code (e.g., generated code 550, 1250,etc.) that is detected by the search can be graphically identified (step2055). The recurring segments in generated code (e.g., generated code550, 1250, etc.) can be replaced (step 2060) and the sections of thegraphical model (e.g., graphical models 500, 1200, etc.) that correspondto the recurring segments can be updated to reflect the replacement ofthe recurring segments (step 2065).

FIG. 21 is a flow diagram illustrating exemplary steps for lockingaspects of a graphical model (e.g., graphical models 500, 1200, etc.)and generated code (e.g., generated code 550, 1250, etc.) from thegraphical model (e.g., graphical models 500, 1200, etc.) to preventmodifying of the locked aspects. A user can generate a graphical model(e.g., graphical models 500, 1200, etc.) (step 2100) and can generatecode (e.g., generated code 550, 1250, etc.) from the graphical model(e.g., graphical models 500, 1200, etc.) (step 2105). The graphicalmodel (e.g., graphical models 500, 1200, etc.) can include unspecifiedparameters that can be inferred by the environment 100 using, forexample, propagation.

The user can lock aspects of generated code (e.g., generated code 550,1250, etc.) or graphical model (e.g., graphical models 500, 1200, etc.)such that the aspects do not change over repeated code generationprocesses or to prevent the editing of the locked aspects (step 2110).In one example, the user can lock variable names, includingauto-generated variable names, and the locked names are honored duringthe code generation processed, and therefore, are maintained. In anotherexample, the unspecified parameters are inferred by the environment 100,and therefore specified by the environment 100. If the user does notlock these inferred parameters, the parameters may change when portionsof the graphical model (e.g., graphical models 500, 1200, etc.) arechanged. If, however, the user locks an inferred parameter, the lockedparameters remain the same. This allows a user to develop generated codebased on unspecified parameters that are inferred a by the environment100 and to retain inferred parameters for subsequent code generation, asif the inferred parameters were specified by the user.

It is observed from the examples discussed herein that the embodimentsof the present invention establish traceability between a graphicalmodel and generated code based on tracing information. It is alsoobserved that once the tracing information is obtained, the tracingtechniques can be extended to entities (e.g., a report, a requirementsdocument, etc.) beyond the graphical model and generated code. FIG. 22is an exemplary diagram of entities that can be mapped using the tracingtechniques. The exemplary diagram includes requirements documentation2210, a design 2220 (i.e., a graphical model), implementations 2230(i.e., generated code) and a code analysis/reports 2240. Therequirements documentation 2210 can include requirements 2212, 2214 and2216 to be met or followed when developing the design 2220. The design2220 is developed based on the requirements 2212, 2214 and 2216 from therequirements documentation 2210. The implementations 2230 are generatedfrom the design 2220. The analysis/reports 2240 can be generated fromthe implementations 2230 and can include a RAM analysis 2242, codeprofile 2244, etc.

Using tracing techniques, the requirements documentation 2210, design2220, implementation 2230 and code analysis/reports 2240 can havetraceability such that aspects of one entity can be traced to anotherentity. Mapping 2250 can use tracing information to facilitategraphically identification of aspects of the entities. Arrows used todepict mapping 2250 are illustrative of how each aspect in an entitycorresponds to an aspect in another entity. As a result of the mappingand tracing information discussed herein, traceability can be employedamong various entities corresponding to the design (e.g., a graphicalmodel).

The present invention may be provided as one or more computer-readableprograms embodied on or in one or more mediums. The mediums may be, butare not limited to a hard disk, a compact disc, a digital versatiledisc, a flash memory card, a Programmable Read Only Memory (PROM), aRandom Access Memory (RAM), a Read Only Memory (ROM), MagnetoresistiveRandom Access Memory (MRAM), a magnetic tape, or even the genome in acell nucleus. In general, the computer-readable programs may beimplemented in any programming language. Some examples of languages thatcan be used include Python™, C, C++, C#, JAVA®, Javascript etc. Further,the computer readable programs can be implemented in a hardwaredescription language or any other language that allows prescribingcomputation such as, for example, Deoxyribonucleic acid (DNA). Thesoftware programs may be stored on or in one or more mediums as objectcode.

Certain embodiments of the present invention are described above. It is,however, expressly noted that the present invention is not limited tothese embodiments, but rather the intention is that additions andmodifications to what is expressly described herein also are includedwithin the scope of the invention. Moreover, it is to be understood thatthe features of the various embodiments described herein are notmutually exclusive and can exist in various combinations andpermutations, even if such combinations or permutations are not madeexpress herein, without departing from the spirit and scope of theinvention.

Since certain changes may be made without departing from the scope ofthe present invention, it is intended that all matter contained in theabove description or shown in the accompanying drawings be interpretedas illustrative and not in a literal sense. Practitioners of the artwill realize that the sequence of steps and architectures depicted inthe figures may be altered without departing from the scope of thepresent invention and that the illustrations contained herein aresingular examples of a multitude of possible depictions of the presentinvention.

1. A method, comprising: identifying a plurality of entities havingrelationships therebetween; accessing a first entity from the pluralityof entities, the first entity including a graphical model that has agraphical affordance; accessing a second entity from the plurality ofentities, the second entity including at least one of a generated codeor an intermediate representation that corresponds to the graphicalmodel; and mapping the first entity to the second entity, using acomputer, to facilitate graphical identification of a bi-directionalmapping between a first part of the first entity, that includes thegraphical affordance depicted in the graphical model, and a second part,of the second entity, that includes a segment, of the at least one ofthe generated code or the intermediate representation, associated withthe graphical affordance.
 2. The method of claim 1, where the first partis a portion, of the graphical model, associated with the graphicalaffordance and the second part is the segment of the generated code. 3.The method of claim 2, where the method further comprises: creating adeployable representation that facilitates generated code inspection ina first environment that is independent of a second environment used todevelop the graphical model.
 4. The method of claim 3, where thedeployable representation comprises a web deployable format.
 5. Themethod of claim 2, where the method further comprises: searching thegraphical model for the portion; and relating the segment with theportion graphically.
 6. The method of claim 5, where the method furthercomprises: replacing the portion with another portion; and updating thesegment to reflect the replacing.
 7. The method of claim 2, where themethod further comprises: updating an inferred property of the portion;and implementing the inferred property as a specified property relatedto the portion.
 8. The method of claim 7, where the method furthercomprises: indicating that the specified property cannot be modified;and preventing the specified property from being modified.
 9. The methodof claim 2, where the method further comprises: searching the generatedcode for the segment; and relating the segment with the portiongraphically.
 10. The method of claim 9, where the method furthercomprises: replacing the segment with another segment; and updating theportion to reflect the replacing.
 11. The method of claim 2, where theportion represents an interface for an element and the segmentrepresents at least part of a function related to the interface.
 12. Themethod of claim 2, where the portion of the graphical model represents auser specified element.
 13. The method of claim 1, where the mapping isperformed by generating tracing information that associates the firstpart with the second part.
 14. The method of claim 13, where the methodfurther comprises: generating an independent representation comprisingthe tracing information.
 15. The method of claim 14, where the methodfurther comprises: identifying a programmable application programinterface (API) that programmatically identifies the first part or thesecond part based on the independent representation.
 16. The method ofclaim 15, where the second entity is the generated code and theprogrammable API allows a user to use an external browser to browse thegenerated code.
 17. The method of claim 15, where the second entity isthe generated code and the programmable API allows a user to use anexternal code debugger to debug the generated code.
 18. The method ofclaim 17, further comprising: synchronizing a graphical model debuggerwith the external code debugger prior to debugging the graphical modelor the generated code.
 19. The method of claim 18, the method furthercomprising: debugging the graphical model and the generated codesimultaneously.
 20. The method of claim 1, where: the first part isrelated to a plurality of parts related to the second entity, or thesecond part is related to a plurality of parts related to the firstentity.
 21. The method of claim 20, where identifying the plurality ofentities further comprises: identifying members of the plurality ofparts related to the first entity or members of the plurality of partsrelated to the second entity using unique graphical identifiers.
 22. Themethod of claim 1, where the second part further includes a section of agenerated report associated with the graphical model.
 23. The method ofclaim 22, where the method further comprises: graphically identifyingthe section based on a selection of the first part.
 24. The method ofclaim 22, where the method further comprises: graphically identifyingthe first part based on a selection of the section.
 25. The method ofclaim 22, where the generated report is one of: a coverage report, amodel checking report, a code generation report, or a profiling report.26. The method of claim 25, where the generated report comprises atleast one of: a partial listing of the generated code, informationrelated to a process used to generate the generated code, or informationrelated to an execution of the generated code or the graphical model.27. The method of claim 22, where the generated report is a modelcoverage report, and the method further comprises: converting, based onmapping between the first entity and the second entity, the modelcoverage report to code coverage report.
 28. The method of claim 22,where the generated report is a code coverage report and the methodfurther comprises: converting, based on mapping between the first entityand the second entity, the code coverage report to a model coveragereport.
 29. The method of claim 1, further comprising: associatingundisplayed aspects of the graphical model with the second part;selecting the second part; and displaying, based on selecting the secondpart, the undisplayed aspects.
 30. The method of claim 1, furthercomprising: specifying a scope for aspects in the graphical model, theaspects related to graphically identifying the second part as at leastone segment that is within the scope that is specified.
 31. The methodof claim 1, where the method further comprises: selecting the first partto graphically identify the second part with a graphical identifier. 32.The method of claim 1, where mapping the first entity to the secondentity includes: receiving information identifying either the graphicalaffordance included in the first part of the first entity or the segmentof the at least one of the generated code or the intermediaterepresentation included in the second part of the second entity, whenthe received information identifies the graphical affordance included inthe first part of the first entity, graphically identifying the segment,of the at least one of the generated code or the intermediaterepresentation included in the second part, that is associated with thegraphical affordance, and when the received information selects thesecond part that includes the segment of the at least one of thegenerated code or the intermediate representation, graphicallyidentifying the graphical affordance included in the first part.
 33. Anon-transitory computer readable medium for use on a computing device,the medium storing instructions executable using the computing device,the instructions for: identifying a plurality of entities havingrelationships therebetween, the plurality of entities having at leastone of a graphical model, generated code, a generated report, arequirements document, or an intermediate representation; accessing afirst entity from the plurality of entities, the first entity includingthe graphical model that includes a graphical affordance; accessing asecond entity from the plurality of entities, the second entityincluding at least one of the generated code or the intermediaterepresentation that correspond to the graphical model; and mapping thefirst entity to the second entity to facilitate graphical identificationof a bi-directional mapping between a first part of the first entity,that includes the graphical affordance depicted in the graphical model,and a second part, of the second entity, that includes a segment, of theat least one of the generated code or the intermediate representation,associated with the graphical affordance.
 34. The computer readablemedium of claim 33, where the first part is a portion of the graphicalmodel associated with the graphical affordance, and the second part isthe segment of the generated code.
 35. The computer readable medium ofclaim 34, where the computer readable medium comprises instructions for:creating a deployable representation that facilitates generated codeinspection in a first environment that is independent of a secondenvironment used to develop the graphical model.
 36. The computerreadable medium of claim 35, where the deployable representationcomprises a web deployable format.
 37. The computer readable medium ofclaim 34, where the computer readable medium comprises instructions for:searching the graphical model for the portion; and relating the segmentwith the portion graphically.
 38. The computer readable medium of claim34, where the computer readable medium comprises instructions for:searching the generated code for the segment; and relating the segmentwith the portion graphically.
 39. The computer readable medium of claim38, where the computer readable medium comprises instructions for:replacing the segment with another segment; and updating the portion toreflect the replacing.
 40. The computer readable medium of claim 34,where the portion further represents an interface of an element of thegraphical model, and the segment represents at least part of a functionrelated to the interface.
 41. The computer readable medium of claim 34,where the portion of the graphical model represents a user specifiedelement developed in textual code.
 42. The computer readable medium ofclaim 33, where the mapping is formed by generating tracing informationthat associates the first part with the second part.
 43. The computerreadable medium of claim 42, where the computer readable mediumcomprises instructions for: generating an independent representationcomprising the tracing information.
 44. The computer readable medium ofclaim 43, where the computer readable medium comprises instructions for:identifying a programmable application program interface (API) thatprogrammatically identifies the first part or the second part based onthe independent representation.
 45. The computer readable medium ofclaim 33, where the first part is related to a plurality of partsrelated to the second entity or the second part is related to aplurality of parts related to the first entity.
 46. The computerreadable medium of claim 45, where the instructions for identifying theplurality of entities further comprises: instructions for identifyingmembers of the plurality of parts related to the first entity or membersof the plurality of parts related to the second entity using uniquegraphical identifiers.
 47. The computer readable medium of claim 33,where the second part is a section of the generated report, and thecomputer readable medium comprises instructions for: graphicallyidentifying the section based on a selection of the first part.
 48. Thecomputer readable medium of claim 47, where the computer readable mediumcomprises instructions for: graphically identifying the first part basedon selection of the section.
 49. The computer readable medium of claim33, where the computer readable medium further comprises instructionsfor: associating undisplayed aspects of the graphical model with thesecond part; selecting the second part; and displaying the undisplayedaspects based on selecting the second part.
 50. The computer readablemedium of claim 33, where the computer readable medium further comprisesinstructions for: specifying a scope for aspects in the graphical model,the aspects related to graphically identifying the second part as atleast one segment that is within the scope that is specified.
 51. Thecomputer readable medium of claim 33, further comprising one or moreinstructions for: receiving information identifying either the graphicalaffordance included in the first part of the first entity or the segmentof the at least one of the generated code or the intermediaterepresentation included in the second part of the second entity, whenthe received information identifies the graphical affordance included inthe first part of the first entity, graphically identifying, to a user,the segment, of the at least one of the generated code or theintermediate representation included in the second part, that isassociated with the graphical affordance, and when the receivedinformation selects the second part that includes the segment of the atleast one of the generated code or the intermediate representation,graphically identifying, to the user, the graphical affordance includedin the first part.
 52. A non-transitory computer readable medium for useon a computing device, the medium storing instructions executable usingthe computing device, the instructions for: identifying a plurality ofentities having relationships therebetween; accessing a first entityfrom the plurality of entities, the first entity including a graphicalmodel that has a graphical affordance; accessing a second entity fromthe plurality of entities, the second entity including at least one of agenerated code or an intermediate representation that corresponds to thegraphical model; and mapping the first entity to the second entity,using a computer, to facilitate graphical identification of abi-directional mapping between a first part, of the first entity, thatincludes the graphical affordance depicted in the graphical model, and asecond part, of the second entity, that includes a segment, of the atleast one of the generated code or the intermediate representation,associated with the graphical affordance.
 53. The computer readablemedium of claim 52, where the first part is a portion, of the graphicalmodel, associated with the graphical affordance and the second part isthe segment associated with the graphical affordance.
 54. The computerreadable medium of claim 53, where the instructions are further for:creating a deployable representation that facilitates generated codeinspection in a first environment that is independent of a secondenvironment used to develop the graphical model.
 55. The computerreadable medium of claim 54, where the deployable representationcomprises a web deployable format.
 56. The computer readable medium ofclaim 53, where the instructions are further for: searching thegraphical model for the portion; and relating the segment with theportion graphically.
 57. The computer readable medium of claim 56, wherethe instructions are further for: replacing the portion with anotherportion; and updating the segment to reflect the replacing.
 58. Thecomputer readable medium of claim 53, where the instructions are furtherfor: updating an inferred property of the portion; and implementing theinferred property as a specified property related to the portion. 59.The computer readable medium of claim 58, where the instructions arefurther for: indicating that the specified property cannot be modified;and preventing the specified property from being modified.
 60. Thecomputer readable medium of claim 53, where the instructions are furtherfor: searching the generated code for the segment; and relating thesegment with the portion graphically.
 61. The computer readable mediumof claim 60, where the instructions are further for: replacing thesegment with another segment; and updating the portion to reflect thereplacing.
 62. The computer readable medium of claim 53, where theportion represents an interface for an element and the segmentrepresents at least part of a function related to the interface.
 63. Thecomputer readable medium of claim 53, where the portion of the graphicalmodel represents a user specified element.
 64. The computer readablemedium of claim 52, where the mapping is performed by generating tracinginformation that associates the first part with the second part.
 65. Thecomputer readable medium of claim 64, where the instructions are furtherfor: generating an independent representation comprising the tracinginformation.
 66. The computer readable medium of claim 65, where theinstructions are further for: identifying a programmable applicationprogram interface (API) that programmatically identifies the first partor the second part based on the independent representation.
 67. Thecomputer readable medium of claim 66, where the second entity is thegenerated code and the programmable API allows a user to use an externalbrowser to browse the generated code.
 68. The computer readable mediumof claim 66, where the second entity is the generated code and theprogrammable API allows a user to use an external code debugger to debugthe generated code.
 69. The computer readable medium of claim 68, wherethe instructions are further for: synchronizing a graphical modeldebugger with the external code debugger prior to debugging thegraphical model or the generated code.
 70. The computer readable mediumof claim 69, where the instructions are further for: debugging thegraphical model and the generated code simultaneously.
 71. The computerreadable medium of claim 52, where: the first part is related to aplurality of parts related to the second entity, or the second part isrelated to a plurality of parts related to the first entity.
 72. Thecomputer readable medium of claim 71, where the instructions are furtherfor: identifying members of the plurality of parts related to the firstentity or members of the plurality of parts related to the second entityusing unique graphical identifiers.
 73. The computer readable medium ofclaim 52, where the second part further includes a section of agenerated report associated with the graphical model.
 74. The computerreadable medium of claim 73, where the instructions are further for:graphically identifying the section based on a selection of the firstpart.
 75. The computer readable medium of claim 73, where theinstructions are further for: graphically identifying the first partbased on a selection of the section.
 76. The computer readable medium ofclaim 73, where the generated report is one of: a coverage report, amodel checking report, a code generation report, or a profiling report.77. The computer readable medium of claim 76, where the generated reportcomprises at least one of: a partial listing of the generated code,information related to a process used to generate the generated code, orinformation related to an execution of the generated code or thegraphical model.
 78. The computer readable medium of claim 73, where thegenerated report is a model coverage report, and where the instructionsare further for: converting, based on mapping between the first entityand the second entity, the model coverage report to code coveragereport.
 79. The computer readable medium of claim 73, where thegenerated report is a code coverage report, and where the instructionsare further for: converting, based on mapping between the first entityand the second entity, the code coverage report to a model coveragereport.
 80. The computer readable medium of claim 52, where theinstructions are further for: associating undisplayed aspects of thegraphical model with the second part; selecting the second part; anddisplaying, based on selecting the second part, the undisplayed aspects.81. The computer readable medium of claim 52, where the instructions arefurther for: specifying a scope for aspects in the graphical model, theaspects related to graphically identifying the second part as at leastone segment that is within the scope that is specified.
 82. The computerreadable medium of claim 52, where the instructions are further for:selecting the first part to graphically identify the second part with agraphical identifier.
 83. A computer implemented method, the methodcomprising: identifying a plurality of entities having relationshipstherebetween, the plurality of entities having at least one of agraphical model, generated code, a generated report, a requirementsdocument, or an intermediate representation; accessing a first entityfrom the plurality of entities, the first entity including the graphicalmodel that includes a graphical affordance; accessing a second entityfrom the plurality of entities, the second entity including at least oneof the generated code or the intermediate representation that correspondto the graphical model; and mapping the first entity to the secondentity to facilitate graphical identification of a bi-directionalmapping between a first part, of the first entity, that includes thegraphical affordance depicted in the graphical model, and a second part,of the second entity, that includes a segment, of the at least one ofthe generated code or the intermediate representation, associated withthe graphical affordance.
 84. The method of claim 83, where the firstpart is a portion of the graphical model associated with the graphicalaffordance, and the second part is the segment associated with thegraphical affordance, and where the method further comprises: creating adeployable representation that facilitates generated code inspection ina first environment that is independent of a second environment used todevelop the graphical model.
 85. The method of claim 84, where themethod further comprises: searching the graphical model for the portion;searching the generated code for the segment; and relating the segmentwith the portion graphically.
 86. The method of claim 83, where mappingthe first entity to the second entity includes: receiving informationidentifying either the graphical affordance included in the first partof the first entity or the segment of the at least one of the generatedcode or the intermediate representation included in the second part ofthe second entity, when the received information identifies thegraphical affordance included in the first part of the first entity,graphically identifying the segment, of the at least one of thegenerated code or the intermediate representation included in the secondpart, that is associated with the graphical affordance, and when thereceived information selects the second part that includes the segmentof the at least one of the generated code or the intermediaterepresentation, graphically identifying the graphical affordanceincluded in the first part.